Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Instantly Changing Desktop Background Color at logon

Status
Not open for further replies.

Bcolvin

Technical User
Sep 23, 2003
10
0
0
Okay, I'm very new at VBScripting but I've managed to create a login script for out NT4.0 Domain. Currently the script will map drives, printers and set a defined desktop image based on department, but I can't seem to change the background color at initial login but instead the changes are reflected after rebooting.

Here's how I'm currently making the change:

oShell.RegWrite "HKCU\Control Panel\Desktop\TileWallpaper","0","REG_SZ"

oShell.RegWrite "HKCU\Control Panel\Colors\Background","0 0 128","REG_SZ"

oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper

oShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveTimeOut","900","REG_SZ"

oShell.Run _
"%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", _
1, True


Any ideas?

Thanks.
 
You should see that this will take affect after logging off and back on, the reboot is not required.

I do the same thing for one of my customers. The good news is that it only happens once unless you are changing the script/policy. After that one time logoff, the setting stays in place and the desired setup will be preserved.

This works this way because the settings are in the HKCU hive rather than Local Machine. These settings are applied at login.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Bcolvin,
Did you ever complete this script? If so, could you post it? If not, I'd like to see what you have because I'm trying to accomplish the same thing.

Thanks,
X
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top