Last active
March 24, 2020 14:52
-
-
Save joedborg/d9aa478c72c9f374bdf5217854419da2 to your computer and use it in GitHub Desktop.
Getting AutoRun registry key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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