MS-DOS and Windows command line logoff command

Updated: 05/21/2018 by Computer Hope
logoff command

Logoff is an external command that allows a user to quickly log off of their computer from the command line or within a batch file.

Availability

Logoff command is an external command that is available for the following Microsoft operating systems as logoff.exe.

Logoff syntax

Windows Vista and later syntax

LOGOFF [sessionname | sessionid] [/SERVER:servername] [/V] [/VM]

sessionname The name of the session.
sessionid The ID of the session.
/SERVER:servername Specifies the Terminal server containing the user session to log off (default is current).
/V Displays information about the actions performed.
/VM Logs off a session on a server or within virtual machine. The unique ID of the session needs to be specified.

Windows XP and earlier syntax

LOGOFF [sessionname | sessionid] [/SERVER:servername] [/V]

sessionname The name of the session.
sessionid The ID of the session.
/SERVER:servername Specifies the Terminal server containing the user session to log off (default is current).
/V Displays information about the actions performed.

Logoff Examples

logoff

Would immediately log off the profile currently logged into Windows.

Note

Running this command does not prompt you if you're sure you want to log off.

Additional information

  • See our logoff definition for further information and related links on this term.