Script help

Wong

Well-Known Member
Joined
Feb 4, 2009
Messages
278
Reaction score
0
Hello , I'm having trouble finding a basic script guide for server 2008 - I need to copy a shortcut onto everyone's desktop - the gpo preference only works for vista and windows 7, the xp clients do not get it therefore hoping a log on script could do it :D any link,guides help would be greatly appreciated
 
Some quick vbscript for you:

Code:
' Creates the shortcut on users desktops.
Dim shtobjShell, shtobjDesktop, shtobjLink
Dim shtstrAppPath, shtstrWorkDir, shtstrIconPath

shtstrWorkDir = ""
shtstrAppPath = "c:\path\whatever.exe"
shtstrIconPath = "C:\path\whatever.exe,0"
Set shtobjShell = CreateObject("WScript.Shell")
shtobjDesktop = shtobjShell.SpecialFolders("Desktop")
Set shtobjLink = shtobjShell.CreateShortcut(shtobjDesktop & "\My Program.lnk")
shtobjLink.Description = "My Program"
shtobjLink.IconLocation = shtstrIconPath
shtobjLink.TargetPath = shtstrAppPath
shtobjLink.WindowStyle = 3
shtobjLink.WorkingDirectory = shtstrWorkDir
shtobjLink.Save

Set shtObjLink = Nothing
Set shtobjShell = Nothing

I call this code via vbs login script. You can paste that into a whatever.vbs and call it.
 
whoah, that's quite long-winded.
I'd dump the shortcut into a public network share and copy it onto everyone's desktop when they logon.


something like:

net use l: \\server\share
cd %userprofile%\desktop
xcopy l:\shotcut
net use l: /D


or am I missing something?
 
Copy \\networkshare\place\shortcut.lnk %userprofile%\desktop
drop it into a batch file and have the file be executed upon login
Done
 
The vbscript is more flexible in that you can change stuff on the fly depending on login location etc.
Copying a .lnk file is much simpler. Didn't even think of that :p I'm too used to the complicated environment that I work in.
 
The vbscript is more flexible in that you can change stuff on the fly depending on login location etc.
Copying a .lnk file is much simpler. Didn't even think of that :p I'm too used to the complicated environment that I work in.

Truth,must be careful not to step into the trap of using a sledgehammer where a rubber mallet would work :P

I'm a fan of using Auto-IT scripts rather than plain VBS where possible,debugging is easier
 
Group Policies can do that so much easier - and some other nifty lock-downs available there too.
Be sure to rather than modify currently existing GPO, copy one and start modifying to your hearts content
 
Hello , I'm having trouble finding a basic script guide for server 2008 - I need to copy a shortcut onto everyone's desktop - the gpo preference only works for vista and windows 7, the xp clients do not get it therefore hoping a log on script could do it :D any link,guides help would be greatly appreciated

easy, deploy this to all XP machines. You get all the Windows 2008/Windows 7 GPO features.

http://support.microsoft.com/kb/943729

We had the same issue here when we started upgrading our machines. We still have mixed environment and found that some of the older GPO's didn't work on Windows 7, so we had to change them to work on Windows 7 and install the update above to make sure they work on XP.
 
Thanks a lot for the help guys ^^ , @avok thanks for that update , that may be part of my problem as well thanks again guys/gals <3
 
Top
Sign up to the MyBroadband newsletter
X