JSI Tip 8791. How can I make Windows recognize the HKCU registry entries I just changed, without a user logoff/logon?

If you have just scripted some changes to the current user's settings, such as REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /D "%SystemRoot%\MyWallPaper.bmp" /F, you can cause Windows to refresh the user settings by running the following commands:

@echo Set oShell = CreateObject("WScript.Shell")>"%TEMP%\UpdatePerUserSystemParameters.vbs"
@echo oShell.Run "%SystemRoot%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True>>"%TEMP%\UpdatePerUserSystemParameters.vbs"
cscript //nologo "%TEMP%\UpdatePerUserSystemParameters.vbs"



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish