Link to home
Start Free TrialLog in
Avatar of Govnah
Govnah

asked on

Push out a shortcut to the desktop.

Is there a way to push/copy a shortcut to a number of PCs in the domian. We are not running profiles so I can't add it there. Can this be done w/ a script or via AD?
Avatar of WerewolfTA
WerewolfTA

Yes.  Here's an example I run through the computer configuration\windows settings\scripts.  It's just a simple bat file.

xcopy "\\dfs-path\shortcut name.lnk" "%allusersprofile%\desktop\" /d /y

Even though you're not running individual profiles, the All Users one should be there.

You can access the c$ share from the command line using the domain admin password (see the NET USE command).

What's the name of the user who's desktop you want to place the shortcut on?
You need to push the file to \\machine\c$\documents and settings\<username>\desktop so you need to know the user.

Or you can pushit to the "allusers" desktop.


Avatar of Govnah

ASKER

What is the syntax to copy a shortcut? I have tried the above suggestions sucessfuly copying a file, but not a shortcut. I keep getting "file not found" when trying to copy the shortcut..


Thanks
Avatar of rhinoceros
You should put the following vbscript into Domain OU's logon script (GPO - User Configuration --> Windows Settings --> Scripts (Logon/Logoff) --> Logon. So all users should have the specific shortcut who are the member of OU, when they login on each domain PC.



For Example: (Create Excel shortcut on Desktop)

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Excel.lnk")
oShellLink.TargetPath = "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE, 0"
oShellLink.Description = "Excel Shortcut"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save


P.S. if you have different version software (e.g. Excel XP - office10 and Excel 2003 - office11), you should further to edit a vbscript more to chcek the actual software path on different PCs.



I hope it can help.
Well, that one works for us.  It depends on what your shortcut name is.  We have .lnk and .pif as extensions for our shortcuts.  If there are any spaces, you have to be sure to enclose the string in quotes.

I actually make the shortcut to the file I want on my computer and then copy the shortcut up to the network share.  If it's pointing to a file on a network drive, that should be it.  Sometimes I've had issues if it's pointing to a file on my computer (& the shortcut should be pointing to a common file on everyone's hard drive).  It sometimes wants to change from, say, c:\program files\... to \\mycomputername\c$\...  Just need to edit the properties of the shortcut to the actual path you want, enclosed in quotes.

try sticking a pause on the last line of your bat so you can see what paths are actually being attempted.  And double-check the permissions on your share.
Avatar of Govnah

ASKER

The shortcut is actually a URL, IE shortcut.



Thanks
Gotcha.  Hadn't tried to do that before.  So, I made an Internet shortcut and used the same .bat format as originally posted.  The IE shortcut didn't show an extension, so had to play with that.  What worked for me was

xcopy "\\path\ieshortcutname.url" "%allusersprofile%\desktop\" /d /y
Avatar of Govnah

ASKER

Also, can you add a line to REMOVE a similiar shortcut and how would I add multiple pc names in one script.


Thanks
ASKER CERTIFIED SOLUTION
Avatar of WerewolfTA
WerewolfTA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, don't know how it worked for Govnah, but my solution is a working, tested one that's used in a production domain (2003 native AD w/ XP clients).  I think those bats should work with Win2k and newer (not sure about nt4).  I think I answered the question as stated, whether pushing a shortcut could be accomplished via a script, via AD.
I have tried all the steps in this solution to copy a IE shortcut to my desktops on my network.

The bat file works fine if I manually launch it. But I can't get GP to launch the bat file. I have put it in the computer scripts startup but it does not launch. Can you please give me some more suggestions.

Thanks in advance.