I have a registry key that contains information for a program that I am running. I have registry key exported to a directory and I can easily import using the regedit Import function. I am having trouble writing a script that does the same using python..
I can read existing keys using the following:
import _winreg as wreg
test = wreg.OpenKey(wreg.HKEY_CURRENT_USER, r'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer', 0, wreg.KEY_READ)
print test
But where I'm having trouble is Importing the key from the directory on my desktop.
Xmcp's comment was actually the answer:
import subprocess
subprocess.call(['reg', 'import', filename])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With