Create a windows shortcut (.LNK file).
Not installed by default, you will find it on the Windows installation CD. Not found on some OEM/Windows 95 installation CD's.
SHORTCUT [-t target] [-a arguments] [-d directory] [-i iconfile] [-x index] [-n name] [-c] [-r] [-f] [-s] [-u [spec]] [-l logfile
none.
MD - Create folder(s).
Equivalent Linux BASH commands:
symlink - Make a new name for a file.
ln - Make links between files.
If shortcut fails to create a new shortcut, it does NOT set an errorlevel.
An alternative for Internet Explorer users is to create a Favourite (.URL) file. These are simple text files which you can create with ECHO statements.
[InternetShortcut] URL=http://www.microsoft.com/
Another option is to use WSH - save the script below with a .VBS extension. (optional sections in the script below are REMed out).
Set oWS = WScript.CreateObject("WScript.Shell") sLinkFile = "C:\MyShortcut.LNK" Set oLink = oWS.CreateShortcut(sLinkFile) oLink.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE" ' oLink.Arguments = "" ' oLink.Description = "MyProgram" ' oLink.HotKey = "ALT+CTRL+F" ' oLink.IconLocation = "C:\Program Files\MyApp\MyProgram.EXE, 2" ' oLink.WindowStyle = "1" ' oLink.WorkingDirectory = "C:\Program Files\MyApp" oLink.Save
@ECHO OFF :: :: Install.cmd :: ECHO setting up MY APP MD %userprofile%"\start menu\programs\MY APP" SHORTCUT -f -t C:\MyApp.exe -n %userprofile%"\start menu\programs\MY APP\MY APP"
none.