Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Registry changes apparently successful, but NO changes actually made!

07 Nov 2014   #1
Thenin

Windows 7 Professional 64-bit
 
 
Registry changes apparently successful, but NO changes actually made!

This is a nasty and incomprehensible problem I've had with two 64-bit Windows 7 SP1 on two separate machines: When I make command-line registry changes, even though no error is thrown, often the changes do NOT actually show up!

I can make changes just fine with any GUI reg editor such as with Regedit or my preferred registry editor, Registrar Registry Manager 7.6 Pro. It's ONLY when I try to do this with a command line that it so often fails.

Here are some examples that usually fail to actually change anything:

Contents of C:\ChangeReg.reg:

Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\ACD Systems\ACDSee Pro\70]
"DBFile"="C:\\Users\\All Users\\AppData\\Local\\ACD Systems\\Catalogs\\70Pro\\Default.dbin"
Contents of Change01.bat:

Code:
NirCmd ElevateCmd RunAsSystem C:\Windows\RegEdit.exe /S "C:\ChangeReg.reg"
IF %ERRORLEVEL% NEQ 0 GOTO :OOPS
Echo "Successfully changed"
GOTO :DONE
:OOPS
Echo "Regedit FAILED"
:DONE
Pause

Contents of Change02.bat:

Code:
C:\Windows\System32\reg.exe IMPORT "C:\ChangeReg.reg"
IF %ERRORLEVEL% NEQ 0 GOTO :OOPS
Echo "Successfully changed"
GOTO :DONE
:OOPS
Echo "Reg FAILED"
:DONE
Pause
Contents of Change03.bat:

Code:
C:\Windows\System32\reg.exe IMPORT "C:\ChangeReg.reg" /reg:64
IF %ERRORLEVEL% NEQ 0 GOTO :OOPS
Echo "Successfully changed"
GOTO :DONE
:OOPS
Echo "Reg FAILED"
:DONE
Pause

Contents of Change04.bat:

Code:
C:\Windows\System32\reg.exe ADD "HKEY_CURRENT_USER\Software\ACD Systems\ACDSee Pro\70" /v DBFile /t REG_SZ /d "C:\Users\All Users\AppData\Local\ACD Systems\Catalogs\70Pro\Default.dbin" /f
IF %ERRORLEVEL% NEQ 0 GOTO :OOPS
Echo "Successfully changed"
GOTO :DONE
:OOPS
Echo "Reg FAILED"
:DONE
Pause
Not a single one of those batch files works! The "FAILED" messages NEVER appear, yet the registry entries remain unchanged.


What's going on? What am I doing wrong?

Thanks!


My System SpecsSystem Spec
.
08 Nov 2014   #2
Thenin

Windows 7 Professional 64-bit
 
 
I solved it myself!

I've been looking for an answer to this riddle for well over a year, but after all that time spent googling and reading and googling and reading, I finally found the answer!

What needs to be done is to include the following command after any of the Reg commands, as seen in any of the last three batch file examples I provided in my OP:

Code:
rundll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True

What that does is to force the system to update the registry changes in HKEY_CURRENT_USER without having to reboot or log-off/log-on again. How I wish someone had told me that!!

(By the way, even that doesn't work with the 'Change01.bat' example, so to hell with doing it that way!)

Of course, you don't need to issue that command after every Reg command that alters anything in the HKU path, but only after you've finished making such changes in the batch file in question.

In the past, using XP Pro, I always used Reg commands to alter the registry in batch files, and it always worked correctly. But when I tried it under 64-bit Windows 7 Pro SP1, I kept getting the problem described in my OP. But now that I know the secret 'trick', things are looking up again!
My System SpecsSystem Spec
Reply

 Registry changes apparently successful, but NO changes actually made!




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Made error w/"Location" tool: Made changes I cannot undo: Local Disk
I am a novice that has run into trouble with Location tools.I have tried Googling the issue, but I am not exactly sure what I have done. I am rebuilding my laptop which has a medium size SSD and a 1Tb hard drive running Windows 7 Professional 64. I have much of my software installed to the SSD...
Installation & Setup
Need proper registry entries to counter changes I made
I made a mistake by not backing up the registry in Windows 7 home premium 32 bit before making a couple changes to the registry. What I need is the proper string value for HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders and then the string value for Favorites ...
General Discussion
Apparently I don't own anything...
Last night I did a foolish thing, simply trying to rename my user file folder to something more manageable. I didn't really think much about it but now I have apparently screwed several things up by trying to force the computer to let me own those files in order to rename them. I downloaded a...
General Discussion
HDs going to sleep, apparently
Hi all - if this is better off in another dept., please feel free to move. I have 3 SATA 7200 rpm 1 TB hard drives installed. The drives occasionally go to sleep on me. I come back to my computer after not using it for a while, d-click on My Computer, and it doesn't open right away; I hear the...
General Discussion
7086 apparently available- NOT
Just came across this on one of my link clicking session. Don't know what to make of it but I'm sure it'll cause a lot of excitement. This might be against forum rules, if it is I apologise sincerely. Not tried myself until it is at least confirmed. p.s mods remove links if I'm in wrong...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:02.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App