What is Mstsc.exe & How to Properly Use it
MSTSC lets you establish Remote Desktop connection
4 min. read
Updated on
Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more
Key notes
- MSTSC lets you run the Microsoft Remote Desktop client to connect with PCs on the same server.
- Here we have explained the complete mstsc syntax and the meaning of each of its parameters.
The mstsc.exe is located in Windows 11 inside the C:\System32\ folder. MSTC stands for Microsoft Terminal Service Client and is an executable file.
In this guide, we will discuss some important things such as what is mstsc.exe and how you can properly use it. Let us get right into it.
What is mstsc.exe used for?
Remote Desktop is an important Windows feature that is used by millions across the globe. With the mstsc.exe or Microsoft Terminal Service Client (MSTSC), you can run the Microsoft Remote Desktop (RDP) client.
Meaning, you can use the mstsc command to establish a remote connection with someone else’s computer. This can let you edit or tweak things as if you were using their computer by being physically present there.
You have to be on the same network to establish the remote connection. The mstsc command is run using the Windows Command Prompt and it is vital to manage the desktop.
What is the syntax for the mstsc command?
The syntax of the mstsc command is:
mstsc.exe [<connectionfile>] [/v:<server>[:<port>]] [/g:<gateway>] [/admin] [/f<fullscreen> ] [/w:<width> /h:<height>] [/public] [/multimon] [/l] [/restrictedadmin] [/remoteguard] [/prompt] [/shadow:<sessionid>] [/control] [/noconsentprompt]
mstsc.exe /edit <connectionfile>
Below is the basic understanding of common mstsc parameters:
Parameter | Description |
---|---|
<connectionfile> | The name of the .rdp file required for connection. |
/v:<server>[:<port>] | Specifies the remote computer or the port number to which you want to connect. |
/g:<gateway> | It is the RD Gateway server that will be used for the connection. Only required if endpoint remote PC is specified with /v. |
/admin | To establish the connection as an admin. |
/f | To view the remote desktop in full-screen mode. |
/w:<width> | To specify the width of the Remote Desktop window. |
/h:<height> | To specify the height of the Remote Desktop window. |
/public | Runs Remote Desktop in public mode, where passwords and bitmaps aren’t cached. |
/multimon | Configures the Remote Desktop Services session monitor layout identical to the client-side configuration. |
/l | Lists the monitor attached to the local PC and the ID associated with each monitor. |
/edit <connectionfile> | Opens up the specified .rdp file for editing. |
/restrictedAdmin | This mode won’t send your credentials to the remote PC. |
/remoteGuard | This mode prevents credentials from being sent to the remote PC. |
/prompt | Asks for your credentials when you connect to the remote PC. |
/shadow:<sessionID> | Specifies the ID of the session to shadow. |
/control | Lets you control the session when shadowing. |
/noConsentPrompt | Lets you control shadowing without user consent. |
/? | Displays help at the CMD. |
How do I run mstsc.exe?
- Press the Win + R keys to open the Run dialogue.
- Type mstsc and press Enter.
(If you want to open the remote connection in fullscreen mode, then you need to type mstsc.exe /f. Also, you can use the above parameters to their advantages as listed above.) - Type the computer name or the IP address of the remote desktop and hit Connect.
Let us now understand how you can enable or disable the remote desktop. For that, check out the next two sections.
How do I enable Remote Desktop?
- Press the Win key to open the Start menu.
- Open Command Prompt as an admin.
- Type the below command and press Enter.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
- Run the below command to enable remote desktop.
netsh advfirewall firewall set rule group="remote desktop" new enable=yes
How do I disable Remote Desktop?
- Press the Win key to open the Start menu.
- Open Command Prompt as an admin.
- Type the below command and press Enter.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
- Run the below command to disable remote desktop.
netsh advfirewall firewall set rule group="remote desktop" new enable=No
How can I fix mstsc.exe crashes?
1. Run the SFC scan
- Press the Win key to open the Start menu.
- Open Command Prompt as an admin.
- Execute the below command.
sfc /scannow
- Wait for the SFC Scan process to complete and fix the corrupt files.
- Restart your PC.
When you come across a mstsc.exe crash or error, then we would suggest you fix the corrupt system files on your PC. This is because often new Windows updates can crash certain system processes.
That is it from us in this guide. Let us know in the comments below, if this helped you understand what mstsc.exe is and how you can use it to establish a remote desktop connection.
User forum
0 messages