I've got a script that will set the wallpaper to an ActiveDesktop, HTML
based wallpaper. I can set the wallaper, but without a reboot or
opening the desktop properties and toggling the wallpaper choice, the
settings don't apply immediately. If there a way to refresh the desktop
or force a refresh programatically, and without having to pop up the
desktop proeprties window?
Here's my scritpt as it stands right now:
'~~~~~~~~~~~~~~ BEGIN CODE
' Set the wallpaper path
WP = "%SystemRoot%\Web\Wallpaper\ActiveWallpaper.html"
' Edit the registry to set the wallpaper choice
Set objShell = CreateObject("WScript.Shell")
objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", ""
objShell.Regwrite "HKCU\Control Panel\Desktop\TileWallPaper", 0
objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaperStyle", 0
objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\WallPaper", ""
objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\TileWallPaper", 0
objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\WallPaperStyle", 0
objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\WallPaper", WP
objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", WP
' Open the Desktop Properties window and toggle/apply to force the
desktop
objShell.Run "control desk.cpl"
WScript.Sleep 300
objShell.AppActivate "Themes"
WScript.Sleep 300
objShell.SendKeys "{tab}"
WScript.Sleep 300
objShell.SendKeys "{tab}"
WScript.Sleep 300
objShell.SendKeys "~"
Set objShell = nothing
'~~~~~~~~~~~~~~ END CODE
Obviously, I'd like to apply the wallpaper without rebooting or having
to mess with the desktop properties window. Any help would be greatly
appreciated!