Save the following text as C:\Windows\RDP.js:
var destination=(WScript.Arguments(0))
var search='rdp://'
var rdpexe='C:\WINDOWS\system32\mstsc.exe'
//WScript.Echo(destination)
destination=destination.replace(search, '')
destination=destination.replace('/', '')
var ws = new ActiveXObject("WScript.Shell")
//WScript.Echo(rdpexe + " /v:" + destination)
ws.Exec(rdpexe + " /v:" + destination)
Save the next piece as RDP.reg:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\rdp]
@="URL:Remote Desktop Connection"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\rdp\DefaultIcon]
@="C:\WINDOWS\System32\mstsc.exe"
[HKEY_CLASSES_ROOT\rdp\shell]
[HKEY_CLASSES_ROOT\rdp\shell\open]
[HKEY_CLASSES_ROOT\rdp\shell\open\command]
@="wscript.exe C:\WINDOWS\rdp.js %1"
Double click and woalya! When you click something like rdp://192.168.0.1 you will be connected to that server by RDP.
8
For those finding this via searches or other sources, try this.
– peelman – 2015-02-07T17:08:09.1531Something like rdp://example.org – Fernando Kosh – 2015-07-23T16:40:15.417
2This answer is obsolete. LJT's one is up to date, with documentation for the new
rdp://
URI scheme. – Lloeki – 2016-09-21T09:04:56.270