Skip to content

TSCON command in Windows

The Windows tscon command is a useful tool for managing Remote Desktop Sessions. It allows users to disconnect and reconnect to a session, providing flexibility and control. By understanding the syntax, parameters, and options of the tscon command, users can effectively manage their Remote Desktop connections.

Terminal window
tscon [sessionid] /dest:console
OptionDescription
sessionidSpecifies the session ID to connect to
/destSpecifies the destination session (e.g., console)
ParameterDescription
sessionidThe numeric ID of the session to connect to
/destThe destination session to connect to (e.g., console)
Terminal window
tscon 2

Connects to session 2 on the local computer.

Connect to Session 10 on Remote Computer “PC1”

Section titled “Connect to Session 10 on Remote Computer “PC1””
Terminal window
tscon /server:PC1 10

Connects to session 10 on the remote computer named “PC1”.

Terminal window
tscon 1 /password:12345

Connects to session 1 on the local computer, providing the password “12345”.

Terminal window
tscon 5 /dest:console

Disconnects session 5 on the local computer.

Terminal window
tscon /query

Displays information about all active sessions on the local computer.

Terminal window
tscon /server:PC2 3 /password:securePW

Connects to session 3 on a remote computer named “PC2”, providing the password “securePW”.

Terminal window
tscon 4 /dest:console

Switches the session to session 4 on the local computer.

Terminal window
tscon /dest:console /v

Disconnects the session specified by the /dest argument and displays additional information.

To use the tscon command in Windows, execute the following command:

Terminal window
tscon <sessionID | sessionname> [/password:<password>] [/v] [/vm]

The tscon command is used to connect to an active session on a Windows system.

How can I disconnect from a session using tscon?

Section titled “How can I disconnect from a session using tscon?”

To disconnect from a session using the tscon command, you can use the following syntax:

Terminal window
tscon <sessionID | sessionname> /dest:console

Can I use tscon to switch to a different session?

Section titled “Can I use tscon to switch to a different session?”

Yes, you can use the tscon command to switch to a specific session by providing the session ID or session name.

How do I list active sessions using tscon?

Section titled “How do I list active sessions using tscon?”

To list active sessions on a Windows system using the tscon command, you can use the following command:

Terminal window
query session

Is it possible to reconnect to a disconnected session with tscon?

Section titled “Is it possible to reconnect to a disconnected session with tscon?”

Yes, you can use the tscon command to reconnect to a disconnected session by specifying the session ID or session name.

What are the options available with the tscon command?

Section titled “What are the options available with the tscon command?”

The tscon command supports multiple options including specifying a password for the session, displaying verbose output, and controlling virtual machines.

To log off a session using the tscon command, you can use the following syntax:

Terminal window
tscon <sessionID | sessionname> /dest:console

Can I use tscon to interact with remote desktop sessions?

Section titled “Can I use tscon to interact with remote desktop sessions?”

Yes, the tscon command can be used to interact with remote desktop sessions by specifying the session ID or session name.

  • Disconnect a remote desktop session
  • Manage terminal server sessions
  • Reconnect to a disconnected session