我试图用这个python脚本禁用autrun但是后面的错误正在......任何人???
from _winreg import *
aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
print r"*** disabling auto run ***"
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", 0, KEY_WRITE)
try:
SetValueEx(aKey,"MyNewKey",0, REG_SZ, r"c:\winnt\explorer.exe")
except EnvironmentError:
print "Encountered problems writing into the Registry..."
CloseKey(aKey)
CloseKey(aReg)
追踪(最近一次通话): **
IDLE Internal Exception:
File "C:\Python27\lib\idlelib\run.py", line 324, in runcode
exec code in self.locals
File "C:\Users\debu\Desktop\proscript\disautorun.py", line 7, in <module>
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", 0, KEY_WRITE)
WindowsError: [Error 5] Access is denied