How to Log Off Windows 10 using CMD

  • Ankita 
  • OS

If you are wondering how to logoff or Shutdown computer using command prompt then the below guide can help you out. This CMD works with Windows 10, 8, 7 and XP. Although there is a very simple and easy option provided by Microsoft to switch the user account or even shutdown, both options are available at the Start button.

How to Logoff using Command Line

The logoff command is used to sign out any unwanted user from your device remotely.

Method 1

To switch the user account, use Logoff command in Run box. This command can be used to log off the system. All you have to follow below steps:

1) Press Ctrl+R key together

2) Type logoff and click on OK

3) This will logoff your system and take you to the login page.

The above command can be used to logoff from the current system.

Method 2

Similarly, you can force a remote computer to logoff from the system using below command:

logoff /server:remote_system_name

Now, let’s have a look at how to shut down the system using Command Prompt. If you want to allow the user to save his work before logging him off remotely, follow the below-given steps:

1) Press the Windows button

2) Type Command Prompt, right-click over it select  Command Prompt (Admin) 

Click on Prompt Admin

3) Select Yes if “User Account Control” dialogue box appears
4) Once the Command prompt window opens, type: shutdown /l or, shutdown -l
5) Type exit to close the command prompt

This will shut down the computer.

Method 3

This method doesn’t include command prompt but you can log off from the system using shortcut keys:

1) Press Ctrl+Shfit+Esc button together

2) Click on User tab

3) Right-click over the currently logged-in user and choose Log Off

Log off system using task manager

This will log-off from the current system and take you to the login page.

How to Shutdown using Command Prompt 

If you want to forcefully logoff the user without giving him the option to save his work, then there are two methods that can be used:

Method A: Using Query command

1) Click on Start, type Command Prompt

2) Right-click over it and choose Command Prompt (Admin) from the pop-up menu

Click on Prompt Admin

3) Select Yes if “User Account Control” dialogue box appears
4) Once the Command prompt window opens, type: query session and hit Enter button

This lists the number of users signed into your device along with their username, ID number, state, type, and device.

5) Choose the user ID affiliated with the person who you want to log off from your device and type: logoff <ID number> without the brackets. This will sign out the affiliated user without giving any alert to him or you.
6)  Check if a user has been logged off by typing: query again. If the logged off user’s name is not in the list of users signed into your device, then the command has been successful.
7) Type exit to close the command prompt

Method B: Using Shutdown command

1) Click on Start button and type Command Prompt

2) Right-click over Command prompt and choose Command Prompt (Admin)

Click on Prompt Admin

3) Select Yes if “User Account Control” dialogue box appears
4) Once the Command prompt window opens, type: shutdown /l /f /t 00 or, shutdown -l -f -t 00 and press Enter
5) Type exit to close the command prompt

nv-author-image

Ankita

Founder and Writer @ WinOSBite. Future plan is to make this platform open to community to resolve and discuss various issues, usage related to Operating System.

Leave a Reply

Your email address will not be published. Required fields are marked *