0

I tried making a quick RDP connection as a batch file with ID, password, etc....

And I found this article:
How do I make a shortcut of a remote desktop connection and include the password?
From user: @user427276, it works well.

In fact, when I connected to the server. the cmd window is still active, and of course, closing only when I close the RDC connection, then it also closes simultaneously.

How is it possible to close this unnecessarily open cmd window without having to close the RDC session and open it?

Io-oI
  • 9,237

2 Answers2

0

Use: Start "" /b [in background] File.RDP


@echo off

start "" /b "C:\Path\To\Your\File.RDP"


Or...

start "" /b "%ComSpec%" /c "cmdkey /generic:"computername or IP" /user:"username" /pass:"password" && mstsc /v:"computer name or IP""
Io-oI
  • 9,237
0

No... just no.

I recommend against doing this. Storing the password unprotected will allow a hacker to target not just your pc, but the remote pc as well.

Instead...

You can open the normal Connect to Remote Desktop program to save your connection to an .rdp file and you can setup there that it can store your username and password. Launching that .rdp file will then directly connect, but if someone steals your .rdp file, they will have to know the password themselves.

Pin the rdp file to your taskbar or start menu

You can store this .rdp file in your My Documents folder, then create a shortcut to the RDP file also in your My Documents folder. Right-click the shortcut, and choose properties to edit it. In front of the filename of your rdp, type in mstsc . So for example, if it already said this: C:\Docs\File.rdp you change it to mstsc C:\Docs\File.rdp.

Your shorcut is now ready to be pinned. Right-click the shortcut and the option Pin to taskbar will now appear.

Pin Remote Desktop to the taskbar and pin your RDP file to its list

Alternatively, you can open the Connect to Remote Desktop program, pin that to the taskbar, and with the program closed, you can right-click the icon and select the .rdp file from the recent list, optionally pinning it there.

In order for your new RDP icon to appear in the recent list, you have to double click the .RDP file once from its original location.

To pin it, after you see it in the list, the pin icon is to the right.

Pinned files will be moved from recently opend to a new list called pinned, ensuring that you will keep it there, even if you have not recently opened the file, or you opened many other files, pushing your connection off the list.

Use another Remote Desktop Client for even more options

Alternatively, you can also use a program such as Remote Connection Manager Free, Royal TS, Devolutions Remote Connection Manager, and there are more, where you configure the RDP connection inside, and you only have to open the app, and then double click the connection you want to start, allowing to have multiple connections in tabs.

LPChip
  • 66,193