Skip to content

Instantly share code, notes, and snippets.

@breakersall
Created September 29, 2016 23:22
Show Gist options
  • Save breakersall/a4fcd14b8e4e91864d00418deee6df7a to your computer and use it in GitHub Desktop.
Save breakersall/a4fcd14b8e4e91864d00418deee6df7a to your computer and use it in GitHub Desktop.
Create .LNK UNC path via PS
$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