Importing reg file doesn't work from batch file, but works fine manually


Senior Member
I just can't figure this out: When I import/merge a .reg file (v5 format) manually by right-clicking the file in Explorer, it works perfectly. But if I try to import the very same .reg file in a batch file, it doesn't do anything!

The .reg file is only changing keys under HKEY_USERS. Here's a sample:

Windows Registry Editor Version 5.00



I'm running 64-bit Windows 7 SP1, and I've disabled UAC, and I run as Administrator, so that's not the problem.
But just in case, in the batch file I used NirSoft's NirCmd ( to elevate the command level to run as System, as follows:
NirCmd.exe ElevateCommand RunAsSystem C:\Windows\Regedit.exe /S "PathToRegFile.reg"
But as I said, nothing in the registry gets changed from that batch file command!

(By the way, before turning to NirCmd out of desperation, it originally said just "Regedit /S "PathToRegFile.reg").

The batch file and commands work correctly under 32-bit XP Pro, but none of those batch files that import reg files work under 64-bit Windows 7!

What's going on?

This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.