Revision #16

You are currently reviewing an older revision of this page.
Go to current version


Introduction


You can launch Remote Desktop Connection from the command line with the mstsc (Microsoft Terminal Services Connection) command. You can enter it from the command prompt, Search box or Run window after clicking Start.

Note: Microsoft renamed Terminal Services to Remote Desktop Services in Windows Server 2008 R2 (for more information click here). However, commands such as mstsc will still work. In other words, the command has not been renamed from mstsc to msrdsc.

The following figure shows the Remote Desktop Connection tool after the Options button has been clicked:





You can also access Remote Desktop Connection tool by choosing Start, All Programs, Accessories, Remote Desktop Connection. Look at the following figure:



At this stage, you can enter the computer name and click Connect. You’ll be prompted to enter the credentials of a user that has permission to log on remotely. Look at the following figure:




Saving Remote Desktop Connection Settings to a File


Note: As you can see in the second figure that there are many different remote desktop related settings that can be configured. Each time you change the settings, they will be saved to a file called default.rdp (the default connection file, default.rdp, is stored as a hidden file in Documents folder). However, you can create your own file for connection specific settings (connection files that you create are also stored in Documents, but they are not hidden). This way the settings for a particular connection will always be remembered. To save the Remote Desktop Connection settings to a file. other that default.rdp file, do the following action:

  • From within the Remote Desktop Connection dialog box, click the Options button. From the General tab, click the Save As button. Type in a file name and choose the location where you want to save the file. Next time you want to initiate a connection using those settings, double click the file you just saved. Look at the following figures:









To edit an .rdp file and change the connections settings it contains, right-click the file and then click Edit. Look at the following figure:



Another way to edit an rdp file is through the use of /edit command. For more information refer to the "mstsc /edit" section of this article.



Exploring Useful "mstsc" Command Switches


Some of the switches you can use with mstsc command are mentioned in the following:


mstsc file path and name


If you have an .rdp file that includes the connection information, you can use it with mstsc. Look at the following example:





mstsc /v:server [:port]


The /v switch enables you to specify which server to connect to and specify the port (the default port is 3389 but it can be changed. For more information on how to change the listening port for Remote Desktop, click here). Look at the following example:




mstsc /f


Connect in full screen mode.




mstsc /w:number


Specifies the width of the screen in pixels.







mstsc /span


Allows spanning across multiple monitors if the local computer is using multiple monitors.



mstsc /multimon


Configures the Remote Desktop session monitor layout to be identical to the current client-side configuration. For more information regarding this feature, click here.



mstsc /public


Runs RDC without caching the passwords and bitmaps.




mstsc /edit file path and name


This command opens the RDC window. You can then edit the settings and save over the original .rdp file by clicking Save. Look at the following example:



Note: The .rdp file is a simple text file. It’s also possible to view and/or edit the file in Notepad. Look at the following figure: