Launching remote desktop from the command line

The  remote desktop connection dialog box provides you with everything that you need to configure and connect to another computer capable of RDP. You can use the Save As button on the Connection Settings panel to save all your connection settings as an RDP file. Then, you can launch and connect to a remote computer simply by double-clicking the RDP file.

You can also script a remote desktop connection. The remote desktop connection executable file is MSTSC.EXE, and the following are some of the most common parameters:

  • /v:<computername>–specifies the name of the computer to connect to.
  • /f–starts the connection in a full screen.
  • /w:<width>–specifies the width of the remote desktop screen.
  • /h:<height>–specifies the height of the remote desktop screen.
  • /admin – connects with admin rights
  • /console – connects to the console of a Windows Server 2003 based system

For example, to remotely connect to a computer named Kaltec in a 640 x 480 remote desktop screen, you would use the following command:

mstsc /v: Kaltec /w:640 /h:480

You can type this command line in the Run dialog box, as well as use it in a batch file.
mstsc.exe {ConnectionFile | /v:ServerName[:Port]} [/console] [/f] [/w:Width/h:Height]

Advertisements

One thought on “Launching remote desktop from the command line

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s