Login Scripts

sycogrim08

Well-Known Member
Joined
Nov 6, 2008
Messages
321
Reaction score
133
Location
JHB - Randburg
Hi All

I wanted to know what script i could use to add on to my login script that changes the users background image to one that I supply from the server so that everytime they logon they get the same image i want to use even if they change it back.

Thanks ;)
 
If I'm not mistaken, there a registry setting that you can use - something along the lines of:
HKCU\Control Panel\Desktop
and there's a key named Wallpaper with a string value of the location of the wallpaper.
 
If I'm not mistaken, there a registry setting that you can use - something along the lines of:
HKCU\Control Panel\Desktop
and there's a key named Wallpaper with a string value of the location of the wallpaper.

Yeh i know that much however im running this script from the domain controller itself....
 
See the link to Scripting Guy. It's something you can add to your logon script, or create a separate vbs script, and call it from your logon script, depending on your existing one.
 
Last edited:
See the link to Scripting Guy. It's something you can add to your logon script, or create a separate vbs script, and call it from your logon script, depending on your existing one.

Yeh thing is do i put it at the top of the login script or do i add specific things and i notice it changes registry keys isnt that dangerous though??? sorry i dont really know much about writing VB and all that... i just wanna be cautious :p
 
What format is your original script in. .vbs form, or .bat form. If it is .vbs, then you should be able to edit it with something like this.

Code:
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."

Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strValue = "C:\WINDOWS\System32\mywallpapername.bmp"


strKeyPath = "Control Panel\Desktop"
ValueName = "Wallpaper"

objReg.SetStringValue HKEY_USERS, strKeyPath, ValueName, strValue

It is merely setting a registry key. No real stresses, as it is changing the users value, not the machine value, so if it breaks the user, delete user and recreate. But it won't break it. You can add this at the beginning or the end of the file. Not a problem. I would recommend the end. If you like, send me you original vbscript file, and I'll clean it up for you
 
What format is your original script in. .vbs form, or .bat form. If it is .vbs, then you should be able to edit it with something like this.

Code:
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."

Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strValue = "C:\WINDOWS\System32\mywallpapername.bmp"


strKeyPath = "Control Panel\Desktop"
ValueName = "Wallpaper"

objReg.SetStringValue HKEY_USERS, strKeyPath, ValueName, strValue

It is merely setting a registry key. No real stresses, as it is changing the users value, not the machine value, so if it breaks the user, delete user and recreate. But it won't break it. You can add this at the beginning or the end of the file. Not a problem. I would recommend the end. If you like, send me you original vbscript file, and I'll clean it up for you

Well the thing is with this string the file is supposed to be based on the actual users machine however the picture i have is on my server and thats where i need it to stay :)
 
Either way, whether the file is remote or local, the OS will cache the image and save a copy of it, usually within the hidden application data folder of the user (under Documents and Settings on WinXP) somewhere... so it's going to end up some way or another on the user's machine... might as well put it there somewhere and reference it :)
 
Yeah rather use GPO as mentioned above. Logon scripts are sooooo 90s :)
 
What format is your original script in. .vbs form, or .bat form. If it is .vbs, then you should be able to edit it with something like this.

Code:
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."

Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strValue = "C:\WINDOWS\System32\mywallpapername.bmp"


strKeyPath = "Control Panel\Desktop"
ValueName = "Wallpaper"

objReg.SetStringValue HKEY_USERS, strKeyPath, ValueName, strValue

It is merely setting a registry key. No real stresses, as it is changing the users value, not the machine value, so if it breaks the user, delete user and recreate. But it won't break it. You can add this at the beginning or the end of the file. Not a problem. I would recommend the end. If you like, send me you original vbscript file, and I'll clean it up for you
Well the thing is with this string the file is supposed to be based on the actual users machine however the picture i have is on my server and thats where i need it to stay :)
Rather use GPO as suggested above. If that's not an option then set the path to \\<server name>\<share name>\wallpaper in the script.
 
Top
Sign up to the MyBroadband newsletter
X