Share via


Applies To: Windows Server 2008, Windows Server 2008 R2, Windows Vista

Creates connections to Remote Desktop Session Host (RD Session Host) servers or other remote computers, edits an existing Remote Desktop Connection (.rdp) configuration file, and migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.

For examples of how to use this command, see Examples.


In Windows Server 2008 R2, Terminal Services was renamed Remote Desktop Services. To find out what's new in this version, see What’s New in Remote Desktop Services on the Windows Server TechCenter.


mstsc.exe [<Connection File>] [/v:<Server>[:<Port>]] [/admin] [/f] [/w:<Width> /h:<Height>] [/public] [/span]

mstsc.exe /edit <Connection File>

mstsc.exe /migrate


Parameter Description

<Connection File>

Specifies the name of an .rdp file for the connection.


Specifies the remote computer and, optionally, the port number to which you want to connect.


Connects you to a session for administering the server.


Starts Remote Desktop Connection in full-screen mode.


Specifies the width of the Remote Desktop window.


Specifies the height of the Remote Desktop window.


Runs Remote Desktop in public mode. In public mode, passwords and bitmaps are not cached.


Matches the Remote Desktop width and height with the local virtual desktop, spanning across multiple monitors if necessary.

/edit <Connection File>

Opens the specified .rdp file for editing.


Migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.


Displays help at the command prompt.


  • Default.rdp is stored for each user as a hidden file in the user's Documents folder. User created .rdp files are saved by default in the user's Documents folder but can be saved anywhere.

  • To span across monitors, the monitors must use the same resolution and must be aligned horizontally (that is, side by side). There is currently no support for spanning multiple monitors vertically on the client system.


  • To connect to a session in full-screen mode, type:

    mstsc /f
  • To open a file called filename.rdp for editing, type:

    mstsc /edit filename.rdp

Additional references

Command-Line Syntax Key

Remote Desktop Services (Terminal Services) Command Reference