create shortcut with batch file

August 26, 2010 at 07:58:23
Specs: Windows XP
I want to create a shortcut file for my exe file located in a folder from cmd i.e with the help of bat file

See More: create shortcut with batch file

Report •

#1
September 1, 2010 at 12:58:09
Use VBScript:
With CreateObject("WScript.Shell").CreateShortcut("C:\Some\Path\Shortcut.lnk")
  .TargetPath = "C:\Some Other\Path\app.exe"
  .WindowStyle = 1
  .IconLocation = "C:\Some Other\Path\app.exe, 0"
  .Description = "Shortcut"
  .WorkingDirectory = "C:\Some Other\Path"
  .Save
End With


Report •

#2
September 2, 2010 at 08:15:58
Thanks man. One quick question though, the image isn't showing up with the original opac.exe desktop icon, it works fine though. Im just thinking teachers wont use it because it doesn't look like the normal "OPAC" icon

Report •

#3
September 2, 2010 at 08:22:45
You'll have to hunt down the icon and modify the script accordingly. If it's not in the .EXE, it's probably an .ICO in the same folder.

Report •
Related Solutions


Ask Question