Skip to content

What is LOGOFF Windows command?

The Windows logoff command allows you to log off a user from the system remotely or from the command line. It is a useful tool for managing user sessions efficiently.

Terminal window
logoff [/?]
OptionDescription
/?Displays help for the logoff command.
ParameterDescription
There are no parameters for the logoff command.
Terminal window
logoff

This command logs off the current user immediately without any warning.

Log off a specific user using their session ID

Section titled “Log off a specific user using their session ID”
Terminal window
logoff 2

Log off the user with session ID 2.

Terminal window
logoff /v 2

Logs off session 2, even if it is disconnected.

Log off the current user and close any running applications

Section titled “Log off the current user and close any running applications”
Terminal window
logoff /l

Logs off the current user and closes any running applications.

Log off the current user with a custom message

Section titled “Log off the current user with a custom message”
Terminal window
logoff /p "Logging off for maintenance"

Logs off the current user and displays the message “Logging off for maintenance” before doing so.

To use the logoff command in CMD, execute the following command:

Terminal window
logoff

What is the purpose of the logoff command?

Section titled “What is the purpose of the logoff command?”

{answer}

How can I log off another user with the logoff command?

Section titled “How can I log off another user with the logoff command?”

{answer}

Is it possible to force a logoff using the logoff command?

Section titled “Is it possible to force a logoff using the logoff command?”

{answer}

Can I use the logoff command remotely on another computer?

Section titled “Can I use the logoff command remotely on another computer?”

{answer}

How do I log off a user with a specific session ID using logoff?

Section titled “How do I log off a user with a specific session ID using logoff?”

{answer}

What are the available options with the logoff command in Windows?

Section titled “What are the available options with the logoff command in Windows?”

{answer}

How can the logoff command be helpful in managing user sessions?

Section titled “How can the logoff command be helpful in managing user sessions?”

{answer}

  • Logging off a user account
  • Ending a remote desktop session
  • Switching users on a shared computer
  • Logging off from a terminal session