I've been trying to change my desktop background with VBScript. It works, however it only takes effect once I restart. Is there a way to update the parameters instantly without restarting?
I've tried restarting explorer to see if that would update the parameters, but it unfortunately doesn't do anything.
Set shell = WScript.CreateObject("WScript.Shell")
path = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
wallpaper = path & "\pp.jpg"
shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper
shell.Run "C:\Windows\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters",1,True
I want the desktop background image to update the moment I run the script. That's what it's supposed to do, but it only updates the parameters and the image when I restart. I would appreciate any help I can get.