|
不多bb直接上代码:
- import inspect,os
- import shutil
- import win32con, win32api
- def path():
- caller_file=inspect.stack()[1][1]
- return os.path.abspath(os.path.dirname(caller_file))
- def copy():
- shutil.copyfile(path()+'autorun.py', 'C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\key.py')
- win32api.SetFileAttributes('C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\key.py', win32con.FILE_ATTRIBUTE_HIDDEN)
- copy()
复制代码 把key.py和autorun.py换成你想自启的文件的文件名
|
|