Hi guys,
Iam not an expert in VBscripting, and I am trying to set a wallpaper
and refresh it (without the user logoff) on winXP, win200 pro, and
win98 using the following script (coz of company marketing strategy).
Iam pushing this script via installshield to more than 1000 computers
with any of above os'.
The script seems to work fine on XP but doesnt work on win2k and
win98. The registries seem to be changing fine but the background
doesnot refresh with the rundll32 userdll call on the last line. Am I
missing anything ??
Please help!! Thanks,
NK
----------------------
----------------------
Dim WshShell, wpFile, wpStyle
set WshShell = CreateObject("Wscript.Shell")
'change this parameter for the destination wallpaper
wpFile = "%windir%\web\wallpaper\dt1.bmp"
'wallpaper style 2-stretch, 1-center;
wpStyle = 2
WshShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper",wpFile
WshShell.RegWrite "HKCU\Control Panel\Desktop\WallpaperStyle",wpStyle
WshShell.RegWrite "HKEY_USERS\.DEFAULT\Control
Panel\Desktop\Wallpaper",wpFile
WshShell.RegWrite "HKEY_USERS\.DEFAULT\Control
Panel\Desktop\WallpaperStyle",wpStyle
'WScript.Echo WshShell.RegRead("HKCU\Control Panel\Desktop\Wallpaper")
'msgbox (WshShell.RegRead("HKCU\Control
Panel\Desktop\WallpaperStyle"))
WshShell.Run _
"%windir%\System32\RUNDLL32.EXE
user32.dll,UpdatePerUserSystemParameters", _
1, False
----------------------
----------------------