How to copy shortcuts in a batch file

  • Thread starter Thread starter Diane Walker
  • Start date Start date
D

Diane Walker

Is there a way to setup a batch file to copy a shortcut to a user's desktop?
For example, I want to setup a batch file so that it will create an Excel
shortcut (Excel.exe) to a user's desktop.

Thanks.
 
Diane Walker said:
Is there a way to setup a batch file to copy a shortcut to a user's
desktop?
For example, I want to setup a batch file so that it will create an Excel
shortcut (Excel.exe) to a user's desktop.

Thanks.

Do you want to copy and existing shortcut to the user's
desktop or to you want to create a brand new shortcut?
 
I want to create a brand new shortcut and put it on the user's desktop.
Thanks.
 
Here is a VB Script example that will create a shortcut on
the user's desktop:
Set ObjShell = CreateObject("WScript.Shell")
strPath=ObjShell.SpecialFolders("Desktop")
Set objShortcut =ObjShell.CreateShortcut(strPath & "\Internet Explorer
Test.lnk")
objShortcut.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe"
objShortcut.arguments = "www.google.com"
objShortcut.Description = "Explorer Test"
objShortcut.Save
 
Thank you very much for taking time to this for me. I have to ask you a
dumb question. Do I copy the script to the notepad and save the file as
executable such as install.bat? I am not sure how to execute the script.

Thanks.

Diane
 
You save it to c:\CreateShortcut.vbs (for example) and invoke
it with this command:

cscript //nologo c:\CreateShortcut.vbs
 
Thanks very much.

Pegasus (MVP) said:
You save it to c:\CreateShortcut.vbs (for example) and invoke
it with this command:

cscript //nologo c:\CreateShortcut.vbs
 
Back
Top