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!

VBScript & Editing Registry on XP Professional

Status
Not open for further replies.

Bcolvin

Technical User
Sep 23, 2003
10
0
0
The following is a part of the login script that I'm writing. It works on our Win2k boxes but not on our XP Pro boxes. The drives and printer both map properly but I can't seem to get the background image and screen saver setting to work. I'm editing these settings in the registry and it works fine on Win2k. Any suggestions?


WshNetwork.MapNetworkDrive "w:", "\\server\folder"
WshNetwork.AddWindowsPrinterConnection "\\server\printer"
WshNetwork.SetDefaultPrinter "\\server\printer"

'Set Background
sWallPaper = "\\server\path\image.bmp"

'Update in registry
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\SCRNSAVE.EXE", sWinDir & "\ssmarque.scr","REG_SZ"

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

oShell.RegWrite "HKCU\Control Panel\Screen Saver.Marquee\Text","Message Here","REG_SZ"

'Refresh Screen to Display Image

oShell.Run _
"%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", _
1, True
 
Is it setting the registry elements but not actually applying to the workstation? If so, you will want to check your Active Desktop setting.

Are you in a Domain? If so you should look at using Group Policy to set this.

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

Regards,

Mark
 
Thanks for responding. After the script runs, the changes aren't even appied to the registry (even after rebooting).
 
I didn't see this before but the script you posted is missing:

Set oShell = Wscript.CreateObject("WScript.Shell")

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

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top