Skip to content

Instantly share code, notes, and snippets.

@tuian
Forked from mttaggart/make-lnk.ps1
Created September 5, 2022 14:43
Show Gist options
  • Save tuian/f851cc567133dec3497eac4c147f060e to your computer and use it in GitHub Desktop.
Save tuian/f851cc567133dec3497eac4c147f060e to your computer and use it in GitHub Desktop.
make-lnk.ps1
param ( [string]$SourceExe, [string]$DestinationPath, [string]$IconPath)
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($DestinationPath)
$Shortcut.RelativePath = "..\..\..\..\..\..\..\..\..\$SourceExe"
$Shortcut.IconLocation = $IconPath
$Shortcut.TargetPath = $SourceExe
$Shortcut.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment