3

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.

RK Coder
  • 398
  • 2
  • 14
user28849
  • 71
  • 1
  • 5

1 Answers1

2

Xmcp's comment was actually the answer:

import subprocess
subprocess.call(['reg', 'import', filename])
BoppreH
  • 8,014
  • 4
  • 34
  • 71
Lukas Kalinski
  • 2,213
  • 24
  • 26