• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1039
  • Last Modified:

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?
0
pillbug22
Asked:
pillbug22
  • 3
1 Solution
 
pillbug22Author Commented:
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.
0
 
pillbug22Author Commented:
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.
0
 
pillbug22Author Commented:
I've been able to re-run the script about once every 5 minutes, which I beieve should be sufficient for what we're doing...

Guess there is a time limit on the rundll32.exe. At least now I know!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now