I have a set of "Registry Hive Files (.)" that am attempting to import via PowerShell. The goal is to have the script run across many machines in the environment and not have to manually do it via RegEdit on each machine.

Is there a way to import hive files via PowerShell?

Trying "regedit.exe hivefile" does not work. These hive files are going in HKLM.

  • 1
    The answer will depend a little bit on your environment. Basically the way I do this typically is to remotely execute reg.exe /I <FILENAME>. How you remotely execute it depends on your environment. If you have remoting available on all the remote machines you can use Enter-PSSession. If not you could use a utility like pscexec.exe
    – EBGreen
    Nov 18, 2015 at 21:08
  • 1
    Are you on a domain? If so, use Group Policy Preferences instead. Or perhaps just use standard Group Policies and a computer start-up script containing a one-line batch reg import yourfile.reg or regedit /s yourfile.reg. Nov 18, 2015 at 21:29
  • Also, you say "Trying "regedit.exe hivefile" does not work." In what way does it "not work"? Nov 18, 2015 at 21:31

1 Answer 1


I actually found the REG RESTORE command. This command did the trick and I was able to get the HIVE file imported successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.