What does Windows do when you turn off your computer or log out of Windows?
When a user shuts down, restarts or logs off from a PC, Windows will do a lot of work in the background to make sure all work and user data are saved completely.
Windows checks to see if any users are still logged in
First, when the user shuts down or restarts, Windows will check to see if another user account is working. Because the user can log in to an account then only lock the session and not log out and log in with another account.
If an account is not logged out, Windows will display a message to the user: "Someone else is still using this PC" - Someone is still using this PC. If you reboot, all unsaved data in running applications will be lost. In this case, the user should stop the shutdown process, log in to the other account to save all work, then log off before continuing to shutdown.
If you are sure that the other account has nothing to save, Windows allows the user to choose "Shutdown anyway" - Continue to shut down the computer. Then the other account will have to log out, all applications will be closed and unsaved data will be lost.
If there are no login accounts, Windows will not issue any notifications and continue the next phase.
Windows sends commands to the program to save data and close it
Logging out is an essential part of the shutdown process and it happens even when you reboot or shutdown. Before you log out of your PC, Windows will send the WM_QUERYENDSESSION command to every program you are open so that they can store data and close it. This process will take a bit of time and this is why the shutdown and logout process sometimes take longer than usual.
If applications need to interact with users (opening files that users need to save), they can 'block' this process. At that time, Windows will announce "This app is preventing shutdown" - This application is preventing the shutdown. Or the application can give a custom message with the function ShutdownBlockReasonCreate.
If you see this message appear, users can stop the shutdown process by clicking the 'Cancel' button to check the application. If not interested, you can skip by clicking "Shutdown anyway" or "Sign out anyway".
Windows logs users out of the system
After closing all applications, Windows will perform many separate actions to log out of the system. All jobs in that user's account will end.
For example, when you log out, the registry contents of the account that are normally stored in memory will be saved to the hard disk to reload into memory the next time you log in.
If only logged out, Windows will bring the user to the login screen. If you turn off the computer or restart another process, start.
Windows turns itself off
After logging out all users, Windows will send the SERVICE_ACCEPT_PRESHUTDOWN command to all running services and 'give' them 20 seconds to clean, save all the data needed to the hard disk and turn it off before Windows 'coercive' off them. .
The "Fast Startup" feature in Windows 10, will save the kernel state to disk and can be reloaded at the next boot to make this process faster due to skipping the hardware initialization process which is quite slow. .
In the final stage of the shutdown process, Widows also installs all available updates.
In addition, many other update tasks are also performed by Windows at various times, including: shutdown, start-up, and background when the machine is operating.
Next, Windows will unmount SSDs and HDDs, wait for the signal that the system data is saved to the hard disk.
Windows turns off your PC
Finally, Windows sends the ACPI signal off to the PC to power off the system, officially completing the shutdown process.
With Windows 95 (no signal turned off APCI), the system will display a "It is now safe to turn off your computer" message, users will have to press the power button to turn off the computer. Since 1996, when the ACPI standard was released, Windows has been allowed since then to turn off the PC itself.
There is a slight difference if users choose to sleep or hibernate. With sleep (sleep), the PC will still run in very low power mode. As for hibernate, the entire system state will be saved to the hard disk and when the user opens the machine, the system will restore.
See more:
- Ways to turn off Windows 10 computer
- How to turn off Windows 10 computer without waiting for the update to install
- How to fix computer errors without completely turning off the power
- How to turn off your computer quickly with a keyboard on Windows
You should read it
- How to turn off Windows 10 computer without waiting for the update to install
- 3 ways to turn off the Windows 10 firewall, steps to turn off the firewall on Windows 10
- How to automatically turn on the computer on Windows
- Instructions for scheduling a Windows 10 computer shutdown
- Fix the problem that the PC turns on but doesn't turn on the screen
- Trick to turn off the computer from the right-click menu on Windows 8
- How to turn off your computer quickly with a keyboard on Windows
- Ways to turn off Windows 11 PCs
- Ways to turn off Windows 10 computer
- How to turn off, turn on Windows Defender in Windows 10
- Instructions for fixing errors do not turn off Windows 10 computers and laptops
- How to turn off the computer automatically
Maybe you are interested
How to fix the missing language bar error on Windows 11 extremely quickly
Turn off these visual effects to make Windows run smoother!
7 Ways to Customize Windows 11 Notepad
8 settings to change to make your Mac trackpad and keyboard work like Windows
How to add fonts to Word in Windows computer
How to use the file search command on Windows, find saved files