Link to home
Start Free TrialLog in
Avatar of pillbug22
pillbug22

asked on

Win7 desktop wallpaper not refreshing after setting in login .VBS

I'm working on a new login script (.vbs) for our Windows 7 stations, and one line item is to set the desktop wallpaper.

I can seccessfully set the registry key (HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper) to the desired file. I can verify this by checking in the registry itself, and it is also correctly identified as the current background when right-clicking on the desktop and selecting "Personalize". However, the new wallpaper setting is not actually applied to the desktop.

I added a next line in the login script to try and force an update (i.e. http://www.pcreview.co.uk/forums/thread-1579775.php) using rundll.exe user32.dll, but that does not seem to apply the background, either. Even if I try and run the rundll.exe command manually from the command prompt, nothing changes...

I am currently logged in with an account that is in the local admin group, so I wouldn't think it's a permissions thing, but since it's not working, I have no clue. I also saw a few places online talking about needing to make sure it is a specific file format, so I've tried .png, .jpg, and .bmp, all to no avail. Is there something different I need to be doing on Win7?
Avatar of pillbug22
pillbug22

ASKER

Is the rundll32.exe user32.dll potentially only allowed to run after a certain time interval has passed?

I'd been trying all morning with no success, but after going to lunch, coming back, and trying, the script worked as expected and updated the desktop. I immediatly tried again (manually changed the wallpaper to something else, then re-ran the script), but it did not change.

I'll let it sit for a while again and see what happens.
OK, just over an hour later, and the script works again. Seems to be time-related. Guess I'll start cutting down on the time inbetween running it and see what the magic number seems to be.
ASKER CERTIFIED SOLUTION
Avatar of pillbug22
pillbug22

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial