How to Log Into Remote Desktop With a CMD Prompt

Written by margaret worthington
  • Share
  • Tweet
  • Share
  • Email

The Windows Remote Desktop Connection program (RDP) is a great way to control computers that you are able to reach over the Internet but not physically. The Remote Desktop program is usually launched from the Start menu in Microsoft Windows, but it is also possible to launch the application from a command (CMD) prompt. Performing this process is reasonably simple, but does require that you are comfortable typing commands into a command prompt instead of using a Graphical User Interface (GUI).

Skill level:

Other People Are Reading

Things you need

  • Windows XP Professional

Show MoreHide


  1. 1

    Open a command prompt by clicking on the "Start" button, then the "Run" button, then typing "CMD" and pressing the "Enter" key. Wait for a black command prompt window to open.

  2. 2

    Decide what computer you want to connect to and note the name or IP address of the server, along with the port (if the RDP port is anything but the default port, 3389).

  3. 3

    Use the following command syntax to begin the Remote Desktop Connection session:

    MSTSC.EXE /V: <computer_name_or_IP>:port {/f | /w: <width> /h: <height>}

    For example, if you wanted to start a full screen connection to the computer "Sally" that has the default RDP port enabled, you would type "MSTSC.EXE /V:SALLY /F." If you wanted to start a connection with a screen size of 800x600 computer with the IP address "" which has an altered RDP port of 3390, you would type "MSTSC.EXE /V: /w:800 /h:600."

  4. 4

    Enter any required login details into the RDP program when it launches.

Tips and warnings

  • You can use the same syntax for the RDP program in the Run window as you did in the command prompt. This can make it faster to launch custom RDP sessions, since the Run window saves the commands that you type in the drop-down box, while you have to enter in the entire command from scratch each time you reopen a command prompt.
  • There is no way to enter in the username and password for the computer you are connecting to when you run the RDP program from the command line. However, once you connect to a computer the first time, you can choose to save your login information so that any subsequent connection attempts won't require that you enter in the username and password.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.