Advertisement

Remote Desktop (mstsc.exe) Command Line Arguments

mstsc.exe is the built-in client software which allows connecting to a computer via Remote Desktop Protocol (RDP). It is a special network protocol which allows a user to establish a connection between two computers and access the Desktop of a remote host. The local computer is often referred to as the "client". If you are running Windows, in most cases you use mstsc.exe to connect to another computer with RDP.

Advertisеment

Note: Any edition of Windows 10 can act as Remote Desktop Client. To host a remote session, you need to be running Windows 10 Pro or Enterprise. You can connect to a Windows 10 Remote Desktop host from another PC running Windows 10, or from an earlier Windows version like Windows 7 or Windows 8, or Linux. Windows 10 comes with both client and server software out-of-the-box, so you don't need any extra software installed.

You can find the shortcut to open a new Remote Desktop session in the Start menu. It is under Windows Accessories\Remote Desktop Connection. See the following screenshot:

Rdp Shortcut Start Menu

Alternatively, you can launch the Remote Desktop connection app from the Run dialog (press Win + R keys together) by typing mstsc.exe in the Run box.

The mstsc.exe app supports a number of useful command line options you can apply in the Run dialog or by running the app from the command prompt or PowerShell. Let's review them.

Remote Desktop (mstsc.exe) Command Line Arguments

Tip: You can see a brief description for available options by running the following command:

mstsc.exe /?

The syntax is as follows:

MSTSC [<connection file>] [/v:<server[:port]>] [/g:<gateway>] [/admin] [/f[ullscreen]] [/w:<width> /h:<height>] [/public] | [/span] [/multimon] [/edit "connection file"] [/restrictedAdmin] [/remoteGuard] [/prompt] [/shadow:<sessionID> [/control] [/noConsentPrompt]]

"connection file" - Specifies the name of an .RDP file for the connection.

/v:<server[:port]> - Specifies the remote PC to which you want to connect.

/g:<gateway> - Specifies the RD Gateway server to use for the connection. This parameter is only read if the endpoint remote PC is specified with /v.

/admin - Connects you to the session for administering a remote PC.

/f - Starts Remote Desktop in full-screen mode.

/w:<width> - Specifies the width of the Remote Desktop window.

/h:<height> - Specifies the height of the Remote Desktop window.

/public - Runs Remote Desktop in public mode.

/span - Matches the remote desktop width and height with the local virtual desktop, spanning across multiple monitors, if necessary. To span across monitors, the monitors must be arranged to form a rectangle.

/multimon - Configures the Remote Desktop Services session monitor layout to be identical to the current client-side configuration.

/edit - Opens the specified .RDP connection file for editing.

/restrictedAdmin - Connects you to the remote PC in Restricted Administration mode. In this mode, credentials won't be sent to the remote PC, which can protect you if you connect to a PC that has been compromised. However, connections made from the remote PC might not be authenticated by other PCs, which might impact application functionality and compatibility. This parameter implies /admin.

/remoteGuard - Connects your device to a remote device using Remote Guard. Remote Guard prevents credentials from being sent to the remote PC, which can help protect your credentials if you connect to a remote PC that has been compromised. Unlike Restricted Administration mode, Remote Guard also supports connections made from the remote PC by redirecting all requests back to your device.

/prompt - Prompts you for your credentials when you connect to the remote PC.

/shadow:<sessionID> - Specifies the ID of the session to shadow.

/control - Allows control of the session when shadowing.

/noConsentPrompt - Allows shadowing without user consent.

Articles of interest:

That's it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.