Logoff command

Updated: 11/12/2023 by Computer Hope
logoff command

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

Availability

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

Note

The logoff command is no longer available in Windows 10.

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 a 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 in to Windows.

Note

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