We help IT Professionals succeed at work.

reg.exe ADD commands to REG_SZ Modifications not showing

786 Views
Last Modified: 2014-08-22
Windows 7, testing batch file, works fine on other keys/values in the default user hive, but I don't think it's working properly for key values that are of the REG_SZ datatypes.

REG LOAD HKU\DefaultUser %SystemDrive%\Users\Default\NTUSER.DAT

%windir%\System32\reg.exe ADD "HKU\DefaultUser\Control Panel\Desktop" /v AutoEndTasks /t REG_SZ /d 1 /f
%windir%\System32\reg.exe ADD "HKU\DefaultUser\Control Panel\Desktop" /v HungAppTimeout /t REG_SZ /d 1000 /f
%windir%\System32\reg.exe ADD "HKU\DefaultUser\Control Panel\Desktop" /v MenuShowDelay /t REG_SZ /d 10 /f
%windir%\System32\reg.exe ADD "HKU\DefaultUser\Control Panel\Desktop" /v WaitToKillAppTimeout /t REG_SZ /d 20 /f
%windir%\System32\reg.exe ADD "HKU\DefaultUser\Control Panel\Desktop" /v LowLevelHooksTimeout /t REG_SZ /d 1000 /f

REG UNLOAD HKU\DefaultUser

Open in new window


So if I run the above, then go into the actual Registry GUI and load the same hive and go to Control Panel\Desktop for the default user's hive, the settings don't appear changed.
MenuShowDelay has a value of 0 for example, when it should have been set to 10 per the command.
But, if I run the reg QUERY command against the key, the values appear to be changed to 10, not 0.

Is it really changed in the Registry? Or do I have to reboot for the changes to show in the Registry's GUI?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2013

Commented:
I don't think you need REG LOAD and REG UNLOAD.
Just add the entries directly into "HKU\.DEFAULT\Control Panel\Desktop"
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
I understand that but I'm saying the Default User registry isn't changing itself.
If I load the Default User hive in command, and update the key to value of 10, and unload it, then I go into Registry and import the same Default User hive, navigate to the key/value I just updated via command, I do not show the changes reflected.
I can see them reflected just fine on DWORD values though
CERTIFIED EXPERT
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Reg Save, not that I'm aware of. Is that suppose to save settings to a file or commit the changes to an actual .dat to commit the registry changes?
I haven't had to use that for the dozens of other keys/values I've modified within the Default User hive and verified.
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
ok ty guys
Your welcome :)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.