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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file to create shortcut Link 1

Status
Not open for further replies.

comp110

MIS
Apr 19, 2004
47
US
Can anyone tell me how to create batch file to create a shortcut to a link to the "all programs" menu and also to the desktop.
We have over a thousand users here in our company and I have to add the link to a software on the all "users start menu program" folder and on the "all users desktop". To make things easier on me without visiting every machine I wanted to e-mail everyone a batch file that would it for me.
 
I know that you can do this using a VB Script

Code:
set WshShell = WScript.CreateObject("WScript.Shell")
set oShellLink = WshShell.CreateShortcut("c:\documents and settings\all users\desktop\software.lnk")
oShellLink.TargetPath = "c:\program_folder\myapplication.exe"
oShellLink.Description = "My Application Shortcut"
oShellLink.Save
set oShellLink = WshShell.CreateShortcut("c:\documents and settings\all users\Start Menu\Programs\software.lnk")
oShellLink.TargetPath = "c:\program_folder\myapplication.exe"
oShellLink.Description = "My Application Shortcut"
oShellLink.Save

Copy the above into a text editor such as notepad and save it as shortcut.vbs

The following lines need to be changed to reflect your preferences:
set oShellLink = WshShell.CreateShortcut("Path shortcut will be located\name of shortcut")

oShellLink.TargetPath = "Path and filename that shortcut will point to"

oShellLink.Description = "Short description of file"

If you need any further details let me know.

Greg Palmer
Freeware Utilities for Windows Administrators.
 
Thank you gpalmer711 for the answer. It did exactly what I wanted to do. I actually added the shortcu to word, excel and access to their desktop also.
Do you have any suggestions what kind of books or website I should visit to learn more about scripting?

thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top