Below is the script to change your desktop wallpaper. You just need to modify the script to point to the location where the 'wallpaper is located.
You can then include this script in your Domain's Group Policy's login or startup script.
' ----------------------------Script to change Desktop Wallpaper-----------------------------------------
dim wshShell
dim sUserNameSet wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "C:\Users\eskonr\Pictures\Nice-Windows-7.jpg"' update in registry
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper' let the system know about the change
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, Truemsgbox "done"
You will have to change the bold letter (image file) with your image file path.
5 Comments
When I run it the first time it changes, but when I run it a second time with a different wallpaper, it doesn't change. Also, when you do it, you have to restart Explorer.
Hi Ryan,
why dont you use group policy to change wallpaper and is most recommended way and it works all time.
Thanks,
Eswar
Because 95% of the environments I manage are NOT a domain environment.
just changes the background to black
can you check the registry for wallpaper patch in HKEY_CURRENT_USER\Control Panel\Desktop\?is it set correctly ?
Regards,
Eswar