Skip to content

Instantly share code, notes, and snippets.

@joedborg
Last active March 24, 2020 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joedborg/d9aa478c72c9f374bdf5217854419da2 to your computer and use it in GitHub Desktop.
Save joedborg/d9aa478c72c9f374bdf5217854419da2 to your computer and use it in GitHub Desktop.
Getting AutoRun registry key
import winreg
cmd = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Command Processor', access=winreg.KEY_WRITE)
winreg.SetValueEx(cmd, 'AutoRun', 0, winreg.REG_SZ, 'myscript.bat')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment