Can you launch Remote Desktop via URL?

40

7

Is it possible to have a URL that launches a remote desktop session? I realize it may be considered a security vulnerability for some, but the convenience would really save me a lot of time.

I would like to have a hyperlink like: remotedesktop://example.org where clicking on it launches mstsc.exe with the target computer filled in (in this case with example.org).

How best to set this up?

optus

Posted 2011-07-18T17:04:02.957

Reputation: 502

Answers

22

You could use a custom URL protocol handler, but this would mean the URLs only worked on computers where you had set this up. I think you'd also need a program to handle taking the URL as remotedesktop://example.org and converting to /v:example.org - although a batch file could probably do this.

See http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx for more information.

xorsyst

Posted 2011-07-18T17:04:02.957

Reputation: 479

8

For those finding this via searches or other sources, try this.

– peelman – 2015-02-07T17:08:09.153

1Something 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

9

For Windows 8.1, Windows Server 2012 R2 there is now the Remote Desktop Client URI Scheme Support

Example: rdp://full%20address=s:mypc:3389&audiomode=i:2&disable%20themes=i:1

See here for the details, including the full list of query string parameters.

LJT

Posted 2011-07-18T17:04:02.957

Reputation: 191

7This does not work on my Win10 Pro -- did it ever actually work? – dualed – 2016-09-29T12:40:36.607

1I second that. I've tried multiple combinations and browers. I even put it into Start->Run, but nothing seems to recognize that URL syntax. I don't think they ever completed support for it. – penguin359 – 2018-01-17T02:02:43.873

1This syntax doesn't apply to Windows. It is only available on Mac, iOS, and Android. The Windows RDP client (mstsc.exe) doesn't support any URL command line argument. You have to use something like the JScript solution linked in xorsyst's answer. – Ian Boyd – 2018-05-03T19:25:11.810

5

I originally said no, but if you have XP, there is something called the Remote Desktop Web Connection. I initially forgot there was a version for XP.

http://www.microsoft.com/download/en/details.aspx?DisplayLang=en&id=18145

http://support.microsoft.com/kb/284931

KCotreau

Posted 2011-07-18T17:04:02.957

Reputation: 24 985

There was something similar for Small Business Server 2003 called Remote Web Workplace, but even then, you could not use a direct URL. http://en.wikipedia.org/wiki/Microsoft_Remote_Web_Workplace

– KCotreau – 2011-07-18T17:10:41.303

Correct me if I'm wrong- this requires me to install/configure something on each server that I would like to connect to? That's going to be prohibitive for me. Thanks though! – optus – 2011-07-18T17:47:33.127

Yes that would be correct. And I agree, it is a pain in the neck...but you asked. :) Support for this was dropped as of Vista. – KCotreau – 2011-07-18T23:08:41.477

3

I think this would work, and might be the effect you are looking for:

With your local copy of Remote Desktop, set up a connection to the target host. But don't connect; instead, save the connection as an RDP file.

Place that file on your web server. Serve the file with a standard <A HREF='path.to.your/file.rdp'> link. (Note: you may need to update your web server config to "download" this file rather than "serve" it to the web browser.)

The user will probably need to know to run the downloaded file... but it should get their computer to launch RD and initiate a connection to the target host.

Dan H

Posted 2011-07-18T17:04:02.957

Reputation: 151

2

This might be useful to someone, but here's an Open Source .NET exe that registers the URL handling off to mstsc: https://github.com/richard-green/MstscLauncher

After running that, it will allow you to click links like this: mstsc://your-server/?w=1024&h=768

user1506319

Posted 2011-07-18T17:04:02.957

Reputation: 21

1

It's not quite what you want, but with Windows Server 2008/R2, you can have your RemoteApps and RDP machines shown on a TS/RD Web Access webpage.

In conjunction with TS/RD Gateway, you could have RDP working through port 443, which is useful in places that block other ports.

TS Web Access

paradroid

Posted 2011-07-18T17:04:02.957

Reputation: 20 970

I sense that he means directly to his computer, like to a home computer. I could be wrong though. – KCotreau – 2011-07-18T17:20:05.420

0

Old topic, but Chrome has a remote desktop plugin to do that.

You also have HTML5 based solutions like Guacamole for Linux or Myrtille for Windows.

cedrozor

Posted 2011-07-18T17:04:02.957

Reputation: 9

Can you clarify what remote desktop plugin you're referring to? – caesay – 2017-11-28T01:25:08.483

That extension is not related to windows RDP whatsoever. It is a completely different protocol requiring you to have this extension configured on both devices. Not sure how this actually answers the question of "How to launch remote desktop from URL". It's also not clear if it would be possible to launch "Chrome Remote Desktop" with a URL either – caesay – 2017-11-30T07:18:03.517

The OP was speaking about mstsc.exe, so RDP indeed; but RDP is just one form of remote desktop; a generic remotedesktop:// link could apply to any remote desktop implementation. An rdp:// link launching mstsc.exe is possible following this solution. There is also the Microsoft remote desktop web access solution. Regarding the chrome remote desktop, it's accessible through the url chrome://apps within chrome.

– cedrozor – 2017-12-01T14:53:34.930

0

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.

George Dudnikov

Posted 2011-07-18T17:04:02.957

Reputation: 11