def setAutoRunWithOsStart(key,app,start=True):
import _winreg
try:
r = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run",0,_winreg.KEY_WRITE)
if start:
_winreg.SetValueEx(r,key,0,_winreg.REG_SZ,app)
else:
_winreg.DeleteValue(r,key)
except:
traceback.print_exc()
评论列表
文章目录