Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to access the registry hive inside of NTUser.dat file?

The reason I am asking is that I frequently install ODBC DSN on computers, and I know that the User DSNs are stored in the registry. If I want to install these DSN drivers quickly, should I somehow edit the NTUser.dat? Export an existing set of registry keys? Maybe use a powershell script to add them to NTUser.dat?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

If NT registry hive is not mounted, you can mount (load) it yourself.

  1. Open regedit.exe
  2. make sure HKEY_LOCAL_MACHINE is selected on the left panel
  3. click File -> Load Hive in the main menu
  4. open ntuser.dat file in common dialog
  5. specify some temporary name, like USER1
  6. make changes
  7. make sure HKEY_LOCAL_MACHINE\USER1 is selected on the left panel and then unload hive from main menu

Registry hives are also loadable and editable from the command line:

REG /?
REG LOAD /?
REG UNLOAD /?

So you may call it from your Powershell or batch script.

But all local user hives are usually automounted in HKEY_USERS. So you need to manually mount only foreign registry hives.

P.S. I prefer the term "mounting" instead of "loading" because loaded registry file not just loaded to RAM, it's locked and being actively changed on disk, so it can't be copied away until dismounted/unloaded.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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