reg.exe ADD commands to REG_SZ Modifications not showing

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?
garryshapeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaauCommented:
I don't think you need REG LOAD and REG UNLOAD.
Just add the entries directly into "HKU\.DEFAULT\Control Panel\Desktop"
0
Rob MinersCommented:
What you are doing is modifing the Default User Profile and by adding those references when a new User Profile is created those references will be added to HKEY_CURRENT_USER\Control Panel\Desktop.

They won't show in the registry until you create a new user account and load their hive or run a reg query against the new user.

You can modify the Ntuser.dat hive so that all newly created users inherit certain settings. Anything that can be defined or modified in HKEY_CURRENT_USER can also be set in the Ntuser.dat hive (for example, international settings, colors, screen savers, sounds, and cursors).

The default user profile is created when Windows NT is installed. The first time a user logs on to a workstation (or domain), the default user profile is copied to the user profile.

Logon as the new user and run this commandline and you will see that your changes have been added to the new users profile.

reg query "HKCU\Control Panel\Desktop" /s > %temp%\deskPan.txt & notepad %temp%\deskPan.txt

ref#      http://support.microsoft.com/kb/146050
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
garryshapeAuthor 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
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

chaauCommented:
OK then, if you insist on loading the registry file, don't you need to REG SAVE it instead of unloading?
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 SAVE HKU\DefaultUser %SystemDrive%\Users\Default\NTUSER.DAT

Open in new window

0
garryshapeAuthor 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.
0
Rob MinersCommented:
Add @echo on and pause to your batch file to see if there are any errors.

@echo on
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

pause

It is working fine for me when I run the command as Administrator.

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

%windir%\System32\reg query "HKU\DefaultUser\Control Panel\Desktop" /v "AutoEndTasks" > %temp%\regQ.txt
%windir%\System32\reg query "HKU\DefaultUser\Control Panel\Desktop" /v "HungAppTimeout" >> %temp%\regQ.txt
%windir%\System32\reg query "HKU\DefaultUser\Control Panel\Desktop" /v "MenuShowDelay" >> %temp%\regQ.txt
%windir%\System32\reg query "HKU\DefaultUser\Control Panel\Desktop" /v "WaitToKillAppTimeout" >> %temp%\regQ.txt
%windir%\System32\reg query "HKU\DefaultUser\Control Panel\Desktop" /v "LowLevelHooksTimeout" >> %temp%\regQ.txt

REG UNLOAD HKU\DefaultUser

start notepad %temp%\regQ.txt
0
garryshapeAuthor Commented:
ok ty guys
0
Rob MinersCommented:
Your welcome :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.