• 0

Login script to change users wallpaper


Question

I work at a company that has about 150 employees, and my boss has asked me to find a way to easily change the users wallpaper via our login script. We do not want to go around to every single persons computer and do it. ive googled it but have not found anything that works. its a domain enviorment and the PC's are running XP SP3 Pro.

We have tried runing active desktop, it worked but not very well.

We use both .bat and .vbs in our login script.

Can anyone help?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Here is a simple VBScript to set the image (and a thing to remember, the majority of configuration settings occur in the Windows Registry, but don't randomly start fiddling with it, otherwise you could damage it).

Dim shell : Set shell = CreateObject("WScript.Shell")
Dim wallpaper : wallpaper = "\\Network\Path\To\Image"

shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper

shell.Run "%SYSTEMROOT%\System32\rundll32.exe user32.dll,UpdatePerUserSystemParameters", 1, True

The last line is important, because it causes the system to update user parameters, things like the desktop background.

You should be able to run that at startup.

Or, as Shaun_ has said, you can enforce it via Group Policy.

Link to comment
Share on other sites

  • 0
Here is a simple VBScript to set the image (and a thing to remember, the majority of configuration settings occur in the Windows Registry, but don't randomly start fiddling with it, otherwise you could damage it).

Dim shell : Set shell = CreateObject("WScript.Shell")
Dim wallpaper : wallpaper = "\\Network\Path\To\Image"

shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper

shell.Run "%SYSTEMROOT%\System32\rundll32.exe user32.dll,UpdatePerUserSystemParameters", 1, True

The last line is important, because it causes the system to update user parameters, things like the desktop background.

You should be able to run that at startup.

Or, as Shaun_ has said, you can enforce it via Group Policy.

Great, worked perfectly! Thanks!

Link to comment
Share on other sites

  • 0

Works for me only when user logs in for the second time. How can I make it work the first time?

I've checked HKCU and it puts path to wallpaper in first time but the shell.Run line doesn't seem to do anything.

The wallpaper is an html file. I've tried changing it to a bmp file but still it only changes on the second logon. But, I really want a different html wallpaper for different user groups without having a different policy for each group. Any ideas please?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.