Skip to content

Instantly share code, notes, and snippets.

@Zeik0s
Last active January 15, 2021 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zeik0s/beb736ab5eacef6ce778af907e37bf98 to your computer and use it in GitHub Desktop.
Save Zeik0s/beb736ab5eacef6ce778af907e37bf98 to your computer and use it in GitHub Desktop.
Shell Extension for modifying an RDP File to use only a single Monitor

Open Regedit.exe for Key Computer\HKEY_CLASSES_ROOT\RDP.File\shell\

I created a new Key "Single Monitor" and put a new Command Key there like the existing for RDP Files.

The Command Key contained a string with name "command" and Value: powershell.exe -windowstyle hidden -command "rm app(*).rdp; (Get-Content "%1").replace('use multimon:i:1','use multimon:i:0') | Set-Content "%1""; mstsc.exe "%1"

This deletes existing rdp files called "App().rdp", replaces the Multimonitor Parameter and opens the Profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment