Launch RDP from commandline

Command Prompt IconA little while ago I wrote a little commandline tool that starts an RDP connection (with mstsc.exe) because mstsc doesn’t allow you to use the login credentials (username, password) as commandline arguments.

Arguments are:

  1. Servername (string)
  2. Port (integer, usually 3389)
  3. Username (string)
  4. Domain (string)
  5. Password (string)
  6. Console (integer, specify 0 for false and 1 for true)
  7. RedirectDrives (integer, specify 0 for false and 1 for true)
  8. RedirectPrinters (integer, specify 0 for false and 1 for true)

Examples:
LaunchRDP MyServer 3389 User Domain Password 0 0 0

For v6 Terminal Server client it also fixes the annoying “do you trust the computer dialog” (shown below) by adding a registry key for the computer you connect to. So next time you connect you won’t be bothered!

Annoying popup

LaunchRDP (14262)

Note: Well, lot’s of people have asked for minimize/maximize buttons and/or the connection bar. No one has made a donation (through the Paypal donate button in the right most sidebar).

So I decided to make this a little challenge: when I receive at least 5 donations I will create an update with the connection bar in it!

/Update: An updated version is here

Leave a Reply

  1. The arguments are mandatory. So to make a connection to server MyServer with account User, domain MyDomain and password Secret you would use:
    LaunchRDP MyServer 3389 User MyDomain Secret 0 0 0

  2. Hi!

    LaunchRDP works fine. Some dreams left:
    Would wish to decide inside the commandline, how RDP will appear: In fullscreen mode or window. If window, a window size argument would be nice and defaulted to 1024 x 768.
    In addition, a certain character should represent a void password (e.g. “*”)
    Maybe I’m silly not seeing how to reach it elsewhere, but asking does not matter?
    Thanx in advance

    Robotnik

  3. Default resolution is screen width and screen height-50, this means that your “local” taskbar always remains visible. I’ll put your questions on the Wishlist ok (I have some more things in mind)?

  4. can you please share the code with us???

    do you have a VC6.0 project with such code (or just .net)?

    i need exactly the knowledge of programtically doing wat you do heare….

  5. It would be helpful if LaunchRDP had command line options for shell and working directory. The alternative would be if LaunchRDP had a command line option for an RDP file.

    Then you could change the MIME type to use LaunchRDP.exe to open RDP files. This way when you download an RDP file from a website the browser would give you the option to open teg RDP file thus launching LaunchRDP.exe to automatically connext to the Terminal Server without prompting the user for credentials.

  6. hello,

    I see that you like delphi programing … me too :)

    Is it possible for you to gave me the source code of Launch RDP command line tool ?

    Many thanks by advance and again congratulation for your work !!

    stephane

  7. Hi,

    This works great.
    I was able to setup login for some apps on citrix without having to give the users a password.

    I was wondering if you have a version that doesnt attempt to login?
    I am just after the ability to set drive access and console without having a .rdp file.
    Currently I have to write a script to populate the reg key that stops the prompt for file access for this to work and call it from a .rdp file.

    thanks
    Cam

  8. Hi there, I just wanted to share how I was able to use your app and specify the rdp screen size and other options, something that a few people seem to want.

    LaunchRDP generates a temporary .rdp file and calls mstsc.exe with it. So by creating your own mstsc.exe and placing it in the same directory as the LaunchRDP.exe, it will get called instead of the real mstsc.exe. In your fake mstsc you can check the first command line parameter to get the location of the .rdp file and alter it yourself before calling the REAL mstsc.exe.

    I hope you don’t mind me doing this Remko but I need a solution right now and it doesn’t look like this project of yours is all that active. /:-)

  9. Hey,

    Can I say great work on this RDP stuff, site’s been a good read and helo.

    Sort of the same request as above:

    Is there any chance of one of the following:

    1. This application as is, but instead of connecting, it generating the .rdp file with the hashed password on the local machine (specified path in command line).

    Option 2: A command line application that takes the plaintext RDP password, and outputs it back into the console in its hashed format.

    Thanks again, looking forward to your reply.

    Dave

  10. Some late replies, I have been very busy…
    @stephane: I can give you my TRDPFile component (which is working but it’s feature complete). It’s a designtime component where you can set all properties of and RDP file (including password), save the rdp file to disk and optionally Launch it.

    @Cam: Can you explain in a little more detail what you mean?

    @Dave: See the comment to Stephane, I wrote the TRDPFile component so that coding such changes would be easier and faster. Time is the issue here because there’s also lot’s of work for the Jedi Apilib, Jedi Security library and TSAdminEx to do.

  11. Greetings,

    any chance of getting a command line switch to redirect the sound ?

    REgards

  12. Great tool and the first that (almost) works for me! ;-)

    Your chosen way to pass parameters makes it impossible to leave out a parameter and keep MSTSC defaults instead. Luckily ” ” works for a unspecified domain name but not for the port. I would very much appreciate if you could switch to standard parameters, such as: /u: /p:

  13. Hi Remko,

    I forgot to mention the second problem: The TS sessions started via LaunchRDP have a crippled window bar. The pin up, minimize and close buttons are missing. Also, it will not reappear when moving the cursor to the upper border of the screen. Could this be a language problem ( I am using German Windows XP SP3 and Windows 2003 R2)

  14. I’m having the same problem with the missing/crippled toolbar under Windows XP SP2 or SP3 (English version). If not for this issue this application would solve my problem!

  15. Missing seems like the word ;-) I wrote the tool for a specific purpose which needed no toolbar.
    Any more people that want the toolbar back??

  16. I must say Remko has done a fantastic and unique work here… Well done!

    I’m doing this:
    LaunchRDP 0 0 0 0 mypass 0 0 0
    while having notepad.exe renamed to mstsc.exe I get the output launched in notepad then the file LaunchRDP.rdp is killed (deleted).

    Could you please compile a version that doesn’t kill LaunchRDP.rdp AND/OR a version that only generates the password?

    Working on a project that requires pushing RDP files between some computers.

    Thank you in advance!

  17. ISSUE: using LaunchRDP.exe from command line to generate a password.

    Found a workaround for my issue and now everything is working…!

    Renamed LaunchRDP.exe to passconv.com (also made some cosmetic changed to it using resource hacker)–This is optional.

    Made 2 VB6 Applications:

    App 1:
    Made an empty binary file called mstsc.exe

    App2:
    Compiled a new file and called it TSC.EXE with the code below:

    Shell (“passconv.com 0 0 0 0 mypass 0 0 0″)
    Shell (“cmd.exe /C type ” & Chr(34) & “%USERPROFILE%\LOCALS~1\Applic~1\LaunchRDP\LaunchRDP.rdp” & Chr(34) & ” | findstr password >> mypassword.text”)

    Saved all the three files in same directory. now running TSC.EXE will generate a password for me :-)
    I’m happy to share my files for those who are intrested.

    For those who don’t want to use VB and program new applications, and just would like to keep it simple please do this:
    1. put an empty file nex to LaunchRDP.exe and call it mstsc.exe
    2. from cmd do: LaunchRDP.exe 0 0 0 0 mypass 0 0 0
    3. type “%USERPROFILE%\LOCALS~1\Applic~1\LaunchRDP\LaunchRDP.rdp” | findstr password

    there you go… your password is there!
    you can also pipe it into a new file by adding >> mypasswd.txt at the end of the third command.

  18. Hoi Remko,

    Erg fijne en handige tool! Wij gebruiken hem in een script waarmee we, vanuit een crm pakket, heel makkelijk onze klanten kunnen overnemen, perfect!

    Echter, bij alle klanten in het CRM staat een RDP adres vermeldt, een username en password. Deze velden gebruik ik als parameters voor launchrdp.exe. Nu hebben wij alleen het domein niet in het CRM staan van de klanten, waarmee ik graag het “default” domein zou willen gebruiken welke 99% van de keren standaard staat ingesteld als je een RDP sessie start. Kan je deze variabele vermijden in de conventionele parameters?

    Groet en bedankt,
    Reinout

  19. does anyone know a similar utility that works on windows CE.
    Remko, do you have an intention of creating such a utility?

    Thanks

  20. @MA: I have been thinking about it actually as I see the purpose. I have to figure out how to create such a project in Delphi, it seems possible… Don’t expect anything soon though as I currently don’t have time.

  21. Remko –

    need a solution for connecting through a TS Gateway 2008.

    currently, if I just have a RDP file with the hashed password inside, it still will not actually work if the client has “lost” the credentials.

  22. Hello remko,
    The LaunchRDP utility is great. It perfectly worked for me. If possible can you provide me the code for it, I would like to use it in one of my applications. By the way which language was it developed in ?

  23. Hello Remko,

    I would like to know if you have solved the problem concerning minimizing the windows of Launch RDP. This option is really important for me…

    Thank you,
    Jean-Michel Robert

  24. Thanks for the app, launching it from an MS Access module which is passing the variables into the commandl line and firing the RDP client, well done!

  25. Remko,
    Does this utility work on 64 bit OS ? If not can you please provide me with the utility that works in 64bit systems. I greatly appreciate if you could help me out.Thanks in advance.

  26. I downloaded the exe and it works fine but i want to know that whether there is an option for /span as there is one for mstsc. This is because i want to use this exe on a thinClient where that thinclient is connected to dual monitor and we need to display on both monitors.

    Kindlt please email me as i am in need of a solution

  27. Great util, however the size does not work – and dont have resize or minimise options. Should they be there ?

    Any chance of adding the size options in ?

    Id also love a copy of your TRDPFile file as well!

  28. Any chance that Launch RDP can be tweaked the be function under vista X64. What I have found is that it creates the LaunchRDP.rdp Were it is supposed to but MSTSC seems to have s difficult time locating it.

  29. @Jean-Michel Robert

    I believe this problem is caused by a RDP Client below version 6. When using MsTscAx.dll minimizing Will not work 100%.

    Remko used the ConnectionbarShowMinimizeButton and ConnectionBarShowRestoreButton to avoid this problem but these settings aren’t supported on RDP Clients prior to version 6.

  30. Hi Remko,

    any chance that we get the minimize and close buttons back soon? I remember you saying that this would not be a big deal?

    This would be really, really great!!

  31. it don’t word in console with dektop remote 6.0.
    why ?
    have you the source please ?
    thank you

  32. Catching up on some (old) comments:
    @Alessandro: starting from v6 /console argument has been replaced with /admin, that’s the issue here.
    @Martin: You are right, but time time time
    @Daniel: is there a xxx32 and xxx64 appdata folder in X64 (I don’t have X64 to test)

  33. Hi,

    cool little app, very useful. However like the others here, it would be very useful to minimize or re-size.

    I would be very happy to have source so i can integrate in my in-house project.

    Thanks!

  34. Very useful – but if it has the minimise buttons etc it would be even better – if anyone can do this I would be willing to pay a little to help…..

  35. [email protected] on

    Remko,

    I am writing an Access database for remote support for my company and if this could be tweaked very slightly it would be perfect – is anyone actively developing this any further?? As it would really help my project.

    Many thanks

    James

  36. Have you decided if you are going to give an option for the tool bar? For my purposes it would make the application perfect.

  37. Well, lot’s of people have asked for minimize/maximize buttons and/or the connection bar. No one has made a donation (through the Paypal donate button in the right most sidebar).

    So I decided to make this a little challenge: when I receive at least 5 donations I will create an update with the connection bar in it!

  38. Can you share your plans with us? Will there be a new version with additional parameters soon?

    I would pay for this (as i did already…)

    Michael

  39. Michael, don’t worry an update for LaunchRDP will appear. I picked up development of TSAdminEx (one of my other tools) a while ago and at this time I’m really focused on finishing that one first.

  40. Hi Remko,

    I also writing a database for remote support the servers of my company. Your tool wokrs perfect, but i also need the minimize buttons. Please could you contact me via email and send me your code. This would really help for my project.

    Many thanks

    Rudi

  41. Hi Remko,

    A while ago I made a donation to get the minimize buttons back. Could I also ask you to give me a sneak preview via mail?

    Martin

  42. Remko, My request from some time back was for the following.

    I have an issue where I need to map local drives, but not login if that makes sense.

    With MSTSC, it doesn’t map local drives without having a .rdp file.
    But with your program you need to specify credentials else it wont work.

    I was hoping there could be a version where I count just specify to map the drives without having to specify the user login details

  43. Hi

    I would like to build a custom RDP Launcher and would like to know where I can find the documentation for the RDC API. Can you suggest a good for the appropriate information?

    Thanks
    Simon

  44. Hi Remko,

    Firstly, congratulations on writing a very useful utility!

    I have a question though: I’m using ‘LaunchRDP’ in a batch file to open multiple servers but I find that the password is only passed to the first server in the list. My batch file looks like this:

    LaunchRDP MyServer1 3389 JDoe MyDomain secret 0 0 0

    sleep 1

    LaunchRDP MyServer2 3389 JDoe MyDomain secret 0 0 0

    sleep 1

    LaunchRDP MyServer3 3389 JDoe MyDomain secret 0 0 0

    etc.

    Could you tell me what I am doing wrong?

    Many thanks

    Richard

  45. Hi, just wondering what the couter is at for the min/max toolbar, this would be perfect for our company of over 200 computers and i would love to make a donation to contribute if it works properly in testing.

  46. Would i please be able to get a copy of this source code, i wish to integrate it with another script i am currently working on

  47. Hi Remko – found your RDP tool and would love to have the toolbar work – plus several more options being able to be forwarded :o)

    But as i am not a paypal user, and do not want to become one, i have problems donating that way.

    Have you already made the version with the toolbar?
    If yes – can i buy a version?
    If no – is there another way than paypal to help you out to get it done?

  48. Hey Remco,
    This is a very cool little app. Could please send me the TRDPFile?

    Thanks!

    David

  49. “So I decided to make this a little challenge: when I receive at least 5 donations I will create an update with the connection bar in it!”

    I have even donated twice but nothing happens. I am afraid this beautiful little app is being abandoned…

  50. To Martin and Maarten:
    I have not abonded this app but I have very little time at this moment. Thanks for understanding…

  51. I’m developing an open source VDI solution based around Xen. It would be of great use to me i could get a copy of the source from you.
    Many thanks.

    David

  52. Hey Remco,

    in what time do you expect you can bring up the new release? I think it would not take to much time for developers like you?

    In case you’ve no time at all: share your source with us!

    Thanks,

    Maarten

  53. Remko,
    I know you’re busy, can you give an idea of the timeline to implement the new changes? This is a great app btw.

  54. LaunchRDP.exe working good BUT i need to connect to admin session like from /admin switch. Anybody have idea how to we can connect to admin session by LaunchRDP or by windows default RDP tool or anyother tool. Because i tried by many softwares. Only way is to connect from Run..mstsc /admin. But i need tool.

    Thanks

  55. ISSUE: using LaunchRDP.exe from command line to generate a password. Found a workaround for my issue and now everything is working…! Renamed LaunchRDP.exe to passconv.com (also made some cosmetic changed to it using resource hacker)–This is optional on

    ISSUE: using LaunchRDP.exe from command line to generate a password.

    Found a workaround for my issue and now everything is working…!

    Renamed LaunchRDP.exe to passconv.com (also made some cosmetic changed to it using resource hacker)–This is optional.

    Made 2 VB6 Applications:

    App 1:
    Made an empty binary file called mstsc.exe

    App2:
    Compiled a new file and called it TSC.EXE with the code below:

    Shell (”passconv.com 0 0 0 0 mypass 0 0 0″)
    Shell (”cmd.exe /C type ” & Chr(34) & “%USERPROFILE%\LOCALS~1\Applic~1\LaunchRDP\LaunchRDP.rdp” & Chr(34) & ” | findstr password >> mypassword.text”)

    Saved all the three files in same directory. now running TSC.EXE will generate a password for me :-)
    I’m happy to share my files for those who are intrested.

    For those who don’t want to use VB and program new applications, and just would like to keep it simple please do this:
    1. put an empty file nex to LaunchRDP.exe and call it mstsc.exe
    2. from cmd do: LaunchRDP.exe 0 0 0 0 mypass 0 0 0
    3. type “%USERPROFILE%\LOCALS~1\Applic~1\LaunchRDP\LaunchRDP.rdp” | findstr password

    there you go… your password is there!
    you can also pipe it into a new file by adding >> mypasswd.txt at the end of the third command.

  56. Hi Remko,

    I appreciate this cool app that is given away for free and I would never even think of urging you to make an update or criticize anything that you create in your free time.

    But it is not fair to make a challenge, saying “when I receive at least 5 donations I will create an update with the connection bar in it!” and then telling us that you are too busy to deliver and not even give us a hint when we can expect this update.

    Besides, getting the Minimize Buttons back (that you explixitly hide in your code) shouldn’t take more than hour of programming time, should it?

  57. This is a great program. I am writing a vb program to do vpn access and have been using msrdp.ocx to do my rdp contections. It works great until I get to VISTA. This will solve my problem, but like everyone else I need the minimize and exit buttons. I will pay to get this done. Or it I could have the code to customize this for what I need, How much would I need to pay.

    Thanks,

  58. Hoi Remko,

    Is er een mogelijkheid om een glimp van je sources te bemachtigen ? (delphi) Tegen betaling ?

    Ik ben erg geinteresseert hoe je het hebt opgelost om geen warning meer te krijgen enz.

  59. Pingback: Small LaunchRDP Update | RemkoWeijnen.nl

  60. Use the code from here to do the encryption. Use vb.net or C to create the RDP file. Works best if you shell to dos and run start mstsc rdpfilename. Flag the shell command as hidden to not see the black winddow. For console access check the version of mstsc.exe if 5 add /Console if 6 use /Admin. The rdp file internals are documented by microsoft. This is not that hard and did not take that long. Launching from dos helps silence the cert complaints.

  61. This is a very nice program, but i have get in to some trouble, LaunchRDP do not work in a server 2008, are you planning to do so? We have installed Password Manager Pro in a citrix environment, and Launch RDP works fine if citrix is installed on server 2003, but not 2008. Do you know a fix or work around?

  62. Very nice work. I came across this article when searching for the same feature. But I am searching for code. Could you please give the source code?

  63. Hey Remko,

    this one is amazing, but it is nto working on the remote machines which i am trying to acces. When i login to the remote machine first it displays a warnign dialog box where i need to press OK and then i will get the login credentials dialog. So your product is failing as it stops near the warnign dialog when i click ok i need to give my password again. Is there a way to resolve this. I even tried your 1.2 version didnt helped. Please advice.

    thanks
    Prady

  64. Hoi Remko,

    Don’t say I’m the first to donate… What’s a poor 5 € these days for all the work this man has done, and saved you a lot of work.
    More donations will give more answers I’m sure, you can find a lot of rdp parameters all over the web, but you need to know how to implement them.

    Johan

  65. great app. Used it for contextual awarness system on a manufacturing floor in the states.

  66. Hello Remko!
    Really liked your program.
    But I miss one. I can not run the program at the entrance to windows.
    For example:% windir% \ system32 \ notepad.exe
    I understand that can be keep it in the PRD file. But I do not want to store my password there.
    Maybe you can specify command-line parameter. Or store it in the PRD file with no other options.
    Thanks in advance for help.

  67. Great Tool !!
    Do you see a possibility to implement this function in a website so start a RDP session with a Hyperlink?

  68. Great Tool !!
    Do you see a possibility to implement this tool in a website to start a rdp session via hyperlink ?