Skip to content

Instantly share code, notes, and snippets.

@jeremyrsellars
Created April 30, 2014 15:08
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyrsellars/364ea48ea067505037ef to your computer and use it in GitHub Desktop.
Save jeremyrsellars/364ea48ea067505037ef to your computer and use it in GitHub Desktop.
RDP Protocol Handler registry
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\rdp]
@="URL:Remote Desktop Protocol <URL:Remote%20Desktop%20Protocol> "
"EditFlags"=dword:00000002
"URL Protocol"=""
[HKEY_CLASSES_ROOT\rdp\shell]
[HKEY_CLASSES_ROOT\rdp\shell\open]
[HKEY_CLASSES_ROOT\rdp\shell\open\command]
@="cmd /V:ON /c setlocal && set url=%1 && set url=!url:rdp://=! && set url=!url:/=! && start mstsc.exe /v:!url!"
@andreapx
Copy link

andreapx commented Feb 8, 2023

Cool, thanks!
Do you know if there's a way to load a rdp file? It's useful for those machines where I have saved the passwords.

@bkelemen92
Copy link

This saved me a lot af hair (to not pull out).
However, when I assing it to a link the RDP address still have the "rdp:" tag in front of the servername and port. I made a little change, now it automatically connects to the specified server:

cmd /V:ON  /c setlocal && set url=%1 && set url=!url:rdp:=! && set url=!url:/=! && start mstsc.exe /v:!url!

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