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?
Who is Participating?
WerewolfTAConnect With a Mentor Commented:
Sure.  Add this to your bat:

del "\\path\shortcut.url" /q

Pretty sure that's the correct syntax.  Double-check before you roll it out.

Based on what you stated in your original ?, you shouldn't need to worry about the pc names.  Using Active Directory, you can place this bat in a group policy under Computer Configuration\Windows Settings\Scripts\Startup (or Shutdown).  The individual computers in that ou will run the script themselves.  

Put the bat file in a network location that they can all reach and you don't even have to push it out to the workstations.  I like to collect my scripts into a scripts folder with subfolders where appropriate.  We put ours in a dfs root, so I can add and remove servers to that dfs and the clients will always be able to reach the files without me needing to change anything.
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.

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

GovnahAuthor Commented:
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..

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

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.
GovnahAuthor Commented:
The shortcut is actually a URL, IE shortcut.

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
GovnahAuthor Commented:
Also, can you add a line to REMOVE a similiar shortcut and how would I add multiple pc names in one script.

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.
All Courses

From novice to tech pro — start learning today.