Skip to content

Instantly share code, notes, and snippets.

@bobby-tablez
Last active January 24, 2024 14:35
Show Gist options
  • Save bobby-tablez/6ee5d7279f68c19d95d2e67ed0efcced to your computer and use it in GitHub Desktop.
Save bobby-tablez/6ee5d7279f68c19d95d2e67ed0efcced to your computer and use it in GitHub Desktop.
PowerShell Shortcut LNK Builder
# Set IconLocation to app or dll to change its appearance https://www.digitalcitizen.life/where-find-most-windows-10s-native-icons/
$LinkStart = New-Object -comObject WScript.Shell;
$lnk = $LinkStart.CreateShortcut("$env:USERPROFILE\Desktop\my_new_shortcut.lnk");
$lnk.IconLocation = "$env:WINDIR\System32\notepad.exe";
$lnk.TargetPath = "cmd.exe"
$lnk.WindowStyle = 7; # hidden
$lnk.ArgUments = '/c calc.exe';
$lnk.Save() | Out-Null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment