Reply To: Update registry for “Default” user

#22943
Avatarnitehawk
Participant
  • Total Post: 11
  • Regular Joe
  • ★★

Got this working.
SF “Fix.cmd” “C:Fix.cmd”
EX “cmd.exe /c c:Fix.cmd” “+”
DF “c:Fix.cmd”

Fix.cmd script:
REG Add “HKCUfix” /v fix /d 1 /t reg_sz /f
IF NOT “%ERRORLEVEL%”==”0” EXIT /B %ERRORLEVEL%
reg load HKLMUser C:UsersDefaultNTUSER.DAT
IF NOT “%ERRORLEVEL%”==”0” EXIT /B %ERRORLEVEL%
REG Add “HKLMUserfix” /v fix /d 1 /t reg_sz /f
IF NOT “%ERRORLEVEL%”==”0” EXIT /B %ERRORLEVEL%
reg unload HKLMUser
IF NOT “%ERRORLEVEL%”==”0” EXIT /B %ERRORLEVEL%

– As it runs as system “HKEY_USERS.DEFAULT” becomes “HKCU”
– the hive “C:UsersDefaultNTUSER.DAT” gets loaded to “HKLMUser”, reg chang done, then unloaded later in the script

Hope the above helps someone else.