Выход из системы windows cmd

on November 25, 2010

We can logoff a user session by clicking on the Logoff button in the start menu. We can logoff from command prompt(CMD) too using shutdown command. You need to run the below command.

shutdown -L

Shutdown is a Windows in-built command. We don’t have to install it separately. Note that we can run this command from windows Run window also. This command works on all windows editions. (XP, Vista, Server 2k3/2k8, Windows 7)

There’s another command Logoff which also serves the same purpose. This command can be used to logoff sessions on the remote computers also. Find syntax below for this.

logoff /server:remote_computer_name

To logoff on the current system

logoff

This does not accept user name and passwords so it uses the credentials of the current logged in user on the host system.

How to force logoff without waiting for user confirmation to terminate the running applications?

The above commands do forced logoffs.  They kill all the applications one by one and at the end logs off the user.

The `logoff` command in CMD is used to log off the current user session, effectively closing all applications and returning to the login screen.

Here’s how to use it:

logoff

What is the Logoff Command?

The logoff command is a powerful tool in the Windows Command Prompt that allows a user to exit their current session on the system. When executed, it effectively closes all applications running in the session and ends the user’s login session, which can be crucial for maintaining system security and resource management.

Mastering Echo Off Cmd: A Quick Guide

Mastering Echo Off Cmd: A Quick Guide

Why Use CMD for Logging Off?

Using the command line to log off presents several advantages over relying solely on the graphical user interface. It can be particularly beneficial in scenarios like:

  • Remote Access: Logging off a user’s session remotely without needing to access the physical system.
  • Batch Processing: Automating logoff tasks via scripts, especially in environments with multiple users.
  • Quick Execution: For power users, typing a command may be faster than navigating menus.

Mastering Boot Cmd: Your Quick Guide to Command Power

Mastering Boot Cmd: Your Quick Guide to Command Power

Understanding the CMD Logoff Command

Basic Usage of Logoff Command

To initiate a logoff, the basic syntax used is:

logoff [sessionid]

In this syntax, sessionid is an optional parameter that specifies the session you wish to log off. Users who access a system can have different session IDs, which helps in managing multiple users effectively.

Where to Access CMD

To use the logoff command, you must have access to Command Prompt. Here’s how to open it:

  1. Press `Windows + R` to open the Run dialog.
  2. Type `cmd` and press `Enter`.
  3. (Optional) For administrative privileges, right-click on Command Prompt and select Run as administrator.

Clone Cmd: A Quick Guide to Cmd Cloning Techniques

Clone Cmd: A Quick Guide to Cmd Cloning Techniques

Logging Off Using CMD

How to Log Off the Current User

For most cases where you want to log off the currently logged-in user, simply typing:

logoff

will suffice. Once executed, this command will immediately log off the session without any further prompts, effectively closing all applications running under that user.

Logging Off a Specific User by Session ID

Finding Session IDs

To log off a specific user rather than the current session, first, you need to identify the session ID. This can be done using the following command:

query user

The output will list active users along with their corresponding session IDs, which can be understood as unique identifiers for user sessions.

Command to Log Off a Specific User

Once you have the session ID, log off that specific user with the command:

logoff [sessionid]

Replace [sessionid] with the actual number obtained from the previous query. This is particularly helpful for network administrators who need to manage user sessions on a shared system.

For Loop Cmd: Mastering Iteration in Cmd Quickly

For Loop Cmd: Mastering Iteration in Cmd Quickly

Logoff Windows CMD Options

Using Logoff with Scripting

The logoff command can easily be incorporated into batch scripts, allowing for automated logging off. For instance, suppose you want to log off users at a certain time each day. Your script may look something like this:

@echo off
logoff

This basic script can be scheduled to run at specified times, ensuring users are logged off without manual intervention.

Log Off via CMD with Timed Delay

If you want to give users a warning before logging them off, you can include a timed delay using the `timeout` command. For example:

timeout /t 60 && logoff

This command will wait for 60 seconds and then log off the current user automatically. This practice ensures that any unsaved work can be addressed before the session ends.

Unlocking Robocopy Cmd: Master File Transfers Effortlessly

Unlocking Robocopy Cmd: Master File Transfers Effortlessly

Advanced Logoff Techniques

Remote Logoff via CMD

In environments where administrating remote systems is necessary, the logoff command can still be effective. For this, you can use the tool PsExec from Sysinternals, which allows you to execute commands on remote PCs. The command looks like this:

psexec \\[computername] logoff [sessionid]

In this instance, replace [computername] with the name of the remote computer and [sessionid] with the user session ID to be logged off. Make sure you have the necessary permissions on the remote machine.

Logoff with Windows Task Scheduler

For users needing to log off at scheduled times, Windows Task Scheduler can be used in conjunction with the logoff command. Setting up a scheduled task to execute the logoff command at a specific time automates user session management effectively.

Force Logoff User Cmd: A Step-by-Step Guide

Force Logoff User Cmd: A Step-by-Step Guide

Troubleshooting Common Logoff Issues

Error Messages and Their Solutions

While using the logoff command, users may encounter various error messages. Common ones include Access Denied, which indicates insufficient permissions. If this occurs, make sure you are executing CMD with administrative privileges.

When Logoff Fails Unexpectedly

If the logoff command does not succeed as expected, it could be due to several factors:

  • Active processes: Some applications may be preventing the logoff. Check for any running applications that may block the session from closing.
  • User permissions: Ensure the account used to issue the command has appropriate rights to log off sessions on that machine.

Top Cmd Tricks for Quick Command Line Mastery

Top Cmd Tricks for Quick Command Line Mastery

Recap of Logoff CMD Functionality

Throughout this guide, we explored the power of the logoff cmd command, understanding its syntax, usage scenarios, and advanced techniques. Whether for individual use or as part of a broader administrative task, mastering this command ensures efficient user session management and system security.

Mastering Xcopy Cmd: The Essential Guide to File Management

Mastering Xcopy Cmd: The Essential Guide to File Management

Additional Resources

For those looking to deepen their command line knowledge, various resources are available online, including official Microsoft documentation and community forums that provide insights into other useful CMD commands. Consider exploring these platforms to expand your CMD skills further.

Все способы:

  • Способ 1: «Пуск»
  • Способ 2: Сочетания клавиш
  • Способ 3: «Командная строка»
  • Способ 4: Windows PowerShell
  • Вопросы и ответы: 3

Изменение некоторых настроек Виндовс 10 выдаёт пользователям запрос о необходимости выйти из системы. Сегодня мы расскажем о методах совершения данной операции.

Способ 1: «Пуск»

Самый простой вариант – воспользоваться меню «Пуск».

  1. Откройте «Пуск», после чего наведите курсор на столбец с иконками.
  2. Открыть пуск для выхода из системы в Windows 10

  3. Один раз кликните левой кнопкой мыши по кнопке с аватаром. Появится меню, в котором воспользуйтесь пунктом «Выход».

Выход из системы посредством меню Пуск в Windows 10

Способ 2: Сочетания клавиш

Быстрый метод выхода из своего профиля заключается в использовании некоторых комбинаций клавиш.

  1. Знакомое опытным юзерам сочетание Ctrl+Alt+Del в Windows 10 вызывает одно из системных меню. Для нашей сегодняшней цели выберите в нём вариант «Выйти».
  2. Меню выхода из системы в Windows 10 через CtrlAltDel

  3. Следующая комбинация – Alt+F4. Перейдите на «Рабочий стол», нажмите нужные клавиши, выберите во всплывающем окне опцию «Выход» и кликните «ОК».
  4. Выход из системы в Windows 10 через AltF4

  5. Выйти из профиля можно и с помощью меню, которое появляется по нажатию Win+X. Нужный нам пункт называется в нём «Завершение работы или выход из системы» – наведите на него мышку, после чего щёлкните «Выход».
  6. Меню WinX для выхода из систем в Windows 10

    Сочетания клавиш представляют собой самый быстрый метод решения поставленной сегодня задачи.

Способ 3: «Командная строка»

Для нашей сегодняшней цели можно использовать и «Командную строку».

  1. Вызовите указанную оснастку от имени администратора – например, напишите в «Поиске» запрос cmd, кликните по результату и выберите в правой части окна требуемую опцию.
  2. Открыть командную строку для выхода из системы в Windows 10

  3. Основной командой выхода из системы является logoff: напишите её и нажмите Enter для применения.
  4. Процесс выхода из системы в Windows 10 посредством ввода первой команды в командной строке

  5. Если эта последовательность по каким-то причинам не работает, можно задействовать другую, shutdown /L.
  6. Выход из системы в Windows 10 посредством ввода вторичной команды в командной строке

    Данный вариант подойдёт юзерам, которые активно пользуются «Командной строкой».

Способ 4: Windows PowerShell

Последний метод ориентирован скорее на продвинутых пользователей, и заключается в задействовании инструмента Windows PowerShell.

  1. Запустить указанную оснастку можно через «Пуск»: откройте меню, найдите в нём папку «Windows PowerShell» и воспользуйтесь ярлыком, соответствующим разрядности вашей ОС.
  2. Открыть PowerShell для выхода из системы в Windows 10

  3. Введите следующий набор операторов:

    (Get-WmiObject Win32_OperatingSystem-EnableAllPrivileges).Win32Shutdown(0)

    Проверьте правильность ввода и нажмите Enter.

  4. Ввести команду в PowerShell для выхода из системы в Windows 10

    Выход из профиля должен начаться автоматически.

Мы рассмотрели методы, посредством которых можно выйти из системы в Windows 10. Как видим, доступные варианты ориентированы на разные категории пользователей.

Наша группа в TelegramПолезные советы и помощь

Signing out of Windows is useful when you need to sign in with another user, apply various settings, and even troubleshoot applications. As opposed to switching users, this action completely shuts down all processes associated with the current user, freeing up resources and preparing Windows 11 for a new sign-in. We have prepared a list of six ways to sign out of Windows 11, but before that, a word of warning:

NOTE: Before signing out of Windows, make sure you save all your work. Signing out closes all applications for the current user, and although Windows will display a warning message if there is unsaved work, it’s much safer to just save it beforehand.

1. Signing out from Windows 11 using the Start Menu

The most straightforward way of signing out from Windows 11 is via the Start Menu. Press the Start button in the taskbar or the Windows key on your keyboard to bring up the Start Menu. Then, click or tap on your profile name, in the lower-left corner of the window. In the menu that appears, select Sign out. No other confirmation is necessary.

Sign out of Windows 11 using the Start Menu

Sign out of Windows 11 using the Start Menu

TIP: If you don’t know how to sign back into Windows 11, read this guide: 5 ways to sign in to Windows 11.

2. Signing out from Windows 11 using the WinX menu

The second method to sign out of Windows is by using the WinX menu, a.k.a the Power User Menu. This menu is a great tool for accessing various features of Windows 11.

Open the WinX menu by either right-clicking (or pressing and holding) the Start button on the taskbar or by pressing Win + X on your keyboard. Next, click or tap on “Shut down or sign out” (or hover over it). In the menu that appears, select Sign out and you’re done.

Sign out of Windows 11 using WinX

TIP: If you like using the WinX Menu, read this article on how to edit the WinX menu and personalize it.

3. Log off using Ctrl + Alt + Del

If you prefer to use keyboard shortcuts, press Ctrl + Alt + Del to bring up a security screen.

Press Del while holding Ctrl and Alt

Press Del while holding Ctrl and Alt

This screen allows you to control various user and accessibility settings, but what we’re interested in now is signing out, so go ahead and click or tap on Sign out. Alternatively, you can use the arrow keys on your keyboard to select the Sign out button, and Enter to press it.

The Ctrl + Alt + Del screen in Windows 11

4. Sign out of Windows 11 by using the “Shut Down Windows” dialog box

You can also sign out using the “Shut Down Windows” dialog box. First, make sure your Desktop is in focus by pressing Win + D on your keyboard. This action minimizes active applications and shows the Desktop. Alternatively, go to the lower right corner of the screen, in the taskbar, and press the Show Desktop button (you might not see it, but it’s there!).

The Show Desktop button

The Show Desktop button

Next, press Alt + F4 on your keyboard. If you have a keyboard that has the Fn key, you might have to Press Alt + Fn + F4 instead.

This brings up the “Shut Down Windows” dialog box. Expand the drop-down list by clicking on it and then click or tap on Sign out. Press OK to execute the command.

Sign out of Windows 11 using the Shut Down Windows dialog box

Sign out of Windows 11 using the Shut Down Windows dialog box

5. Sign out of Windows 11 using Command Prompt or Windows PowerShell

If you’re feeling particularly geeky (or the other methods are not working for some reason), you can sign out using Command Prompt or PowerShell (or even Windows Terminal). The first thing you should do is run either Command Prompt or Windows PowerShell. One way to do it is by opening the Search window and then typing either “cmd” (for Command Prompt) or “powershell” (for PowerShell) in the search field. Press Enter to run the desired shell.

Open the Search window, type powershell and hit Enter

Open the Search window, type powershell and hit Enter

Next, you need to input the following command in the interface, followed by Enter: shutdown /l (with a lowercase L at the end). This command signs you out immediately.

The console command for signing out of Windows 11

The console command for signing out of Windows 11

TIP: the same command can be executed in the Run window (Win +R) and also by typing it in the File Explorer address bar.

6. How to sign out other users from Windows 11 by using Task Manager

While this method can’t be used to sign out of Windows 11 directly, you can use it to sign out other users, provided you have administrative rights to your device. The first step is to open Task Manager. There are many ways to open Task Manager, so we’ll just pick the one we’re most familiar with: press Ctrl + Shift + Esc on your keyboard. Next, click or tap on More details.

Press More details in the Task Manager

Press More details in the Task Manager

Look for the Users tab and click or tap on it. In this tab you see all the users that are currently logged into the device. Select one (other than the user you’re currently logged in with) and then click on Sign Out.

Select the user you want to sign out and then hit the highlighted button

Select the user you want to sign out and then hit the highlighted button

A warning prompt appears, which reminds you that if you sign out a user, their unsaved data might be lost. Since this action “forces” a sign-out of the account, any open documents or files will most likely not be saved. If you wish to continue, click or tap on “Sign out user”.

The confirmation dialog for signing out another user

The confirmation dialog for signing out another user

After the action is completed, the user disappears from the list in the Task Manager window.

Which method to sign out of Windows 11 do you prefer?

We would be interested to know which method you use to sign out of Windows 11. We usually go for the Start Menu approach, but using the WinX menu is also a go-to option. Furthermore, if you know of a method that we missed, please help us improve by sharing it with us in the comment section, and we will update our guide to include it.

There are multiple ways to log off the current user on a Windows system using the command line.  The version of the commands below will depend on the Windows version, the interface you are using to log off the user (e.g. Remote Command Prompt, RMM, Local Command Prompt) etc..

The command to force the current user to log off  immediately using the command line in Windows is:

shutdown /l /f /t 00

Sometimes you will need to use a “-” instead of a “/”

shutdown -l -f -t 00

If you’d like to log off the session giving the current user the chance to save any work you would just exclude the “/f”

shutdown /l

or

shutdown -l

On some remote management systems you can’t issue the shutdown command.  In these cases what you need to do is find out the current user’s active session number by issuing the following command:

query user

Query User

You will then be able to see the current user’s Id and issue the logoff command instead:

logoff 1

Where 1 is the ID of the user you are logging off after performing the query user command.

The following command has been tested on Windows XP, Windows 7, Windows 8, Windows 8.1, Windows 10.  Your mileage may vary on other version of windows.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Ожидание закрытия фоновых программ windows 7 как убрать
  • Windows xp pro sp3 corporate student edition october 2016
  • Как увеличить яркость монитора на ноутбуке windows 7
  • Ошибка не является приложением win32 как исправить windows xp
  • Автоматический вход в windows 10 без ввода пароля после гибернации