Skip to content

Instantly share code, notes, and snippets.

@PSingletary
Created February 25, 2020 03:06
Show Gist options
  • Save PSingletary/b43f7771f7162b3088074b382b7be989 to your computer and use it in GitHub Desktop.
Save PSingletary/b43f7771f7162b3088074b382b7be989 to your computer and use it in GitHub Desktop.
Create RDP icon shortcut on desktop Pre-populate IP address in shortcut
#Source: https://www.reddit.com/r/PowerShell/comments/f91iv8/powershell_rdp_shortcut/fiovdac?utm_source=share&utm_medium=web2x
$wshshell = New-Object -ComObject WScript.Shell
$lnk = $wshshell.CreateShortcut("C:\Users\Public\Desktop\RDP.lnk")
$lnk.TargetPath = "%windir%\system32\mstsc.exe"
$lnk.Arguments = "/v:$IPofTarget"
$lnk.Description = "RDP"
$lnk.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment