Skip to content

Instantly share code, notes, and snippets.

@Wartz
Created March 25, 2020 14:00
Show Gist options
  • Save Wartz/0b2c2cc9b72ef7e8005a0ab5ae09aa2d to your computer and use it in GitHub Desktop.
Save Wartz/0b2c2cc9b72ef7e8005a0ab5ae09aa2d to your computer and use it in GitHub Desktop.
Create a desktop shortcut in the Users\Public\Desktop folder
## Ripped out of an installer script for CapIQ in SB 120 and 105
## Insert your silent install commands here
# Create a desktop shortcut after the app is installed.
function set-shortcut {
param ( [string]$SourceLnk, [string]$DestinationPath )
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($SourceLnk)
$Shortcut.TargetPath = $DestinationPath
$Shortcut.Save()
}
# Replace the paths with <path to shortcut location> and <path to executable>
set-shortcut "C:\Users\Public\Desktop\Internet Explorer.lnk" "C:\Program Files\internet explorer\iexplore.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment