Skip to content

Instantly share code, notes, and snippets.

@rwp0
Last active February 6, 2024 12:04
Show Gist options
  • Save rwp0/45a9626458cf7b0095a24ddd77fe9503 to your computer and use it in GitHub Desktop.
Save rwp0/45a9626458cf7b0095a24ddd77fe9503 to your computer and use it in GitHub Desktop.
Creating Shortcuts on Windows via CLI using VBScript or Git for Windows

https://superuser.com/questions/392061/how-to-make-a-shortcut-from-cmd/1571247#1571247

set shell = WScript.CreateObject("WScript.Shell")
set shortcut = shell.CreateShortcut("C:\MyShortcut.LNK")
shortcut.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE"
shortcut.Arguments = ""
shortcut.Description = "MyProgram"   
shortcut.HotKey = "ALT+CTRL+F"
shortcut.IconLocation = "C:\Program Files\MyApp\MyProgram.EXE, 2"
shortcut.WindowStyle = "1"   
shortcut.WorkingDirectory = "C:\Program Files\MyApp"
shortcut.Save

https://admhelp.microfocus.com/uft/en/all/VBScript/Content/html/d91b9d23-a7e5-4ec2-8b55-ef6ffe9c777d.htm

rem %localappdata%\programs\git\mingw64\bin\create-shortcut.exe
create-shortcut %cd%\bin\script.pl %cd%\Shortcut.lnk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment