Last active
January 24, 2024 14:35
-
-
Save bobby-tablez/6ee5d7279f68c19d95d2e67ed0efcced to your computer and use it in GitHub Desktop.
PowerShell Shortcut LNK Builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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