SoFunction
Updated on 2025-04-10

Does the Windows data corruption result in quick shutdown?

Anhui Zhao Kai readers wrote to: "I recently downloaded a software that shuts down quickly. This software is very powerful and shuts down the computer in almost the blink of an eye. Many people say that this software may destroy data, but they have not given the corresponding basis. I am very conflicted now. I have a good thing, but I dare not use it. Master Dong, I hope you can give an authoritative statement to eliminate my doubts."

Not only is the software mentioned by Zhao Kai's readers able to achieve rapid shutdown, but some techniques can also achieve the same goal, but what consequences will this operation bring? This time, Mr. Zhang Kangzong, who was invited by his master to participate in the discussion of the Windows system and was awarded the most valuable expert of Microsoft in 2004.

From ordinary experience, we can see that the computer will not be powered off immediately after the shutdown operation is executed. Windows will also have a series of actions such as closing the open program. So what is the process from executing the shutdown command to the final power off?
Normal shutdown of Windows involves multiple components and multiple processes. Let's take a look at its basic process.

① After the user initiates the shutdown command, the program that initiates the shutdown command will notify the Windows subsystem. After receiving the notification, it will exchange data with it, and then the notification will start the process of shutting down the system.

②After receiving the notification, the user processes with the top-level window will be queried in turn to allow these user processes to exit. If a user process does not exit within a default timeout of 5000 milliseconds (the timeout time can be set by modifying the registry key value HKEY_CURRENT_USERControl PanelDesktop HungAppTimeout), Windows will display an end task dialog box to ask the user whether to end the task. By default, this dialog box will be displayed and will not be closed automatically.

For console programs, the basic situation is similar, except that Windows uses HKEY_CURRENT_USERControl PanelDesktop WaitToKillAppTimeout to set the timeout time.

③Then it's the turn to terminate the system process。 System processes include、、wait。 When Windows terminates the system process, it does not prompt the user if it cannot terminate within the specified time, just like when it terminates the user process. Instead, it skips the process and executes the termination operation of the next system process. The timeout used is the same as the time used in step 2.

Normal shutdown of Windows involves multiple components and multiple processes. Let's take a look at its basic process.

① After the user initiates the shutdown command, the program that initiates the shutdown command will notify the Windows subsystem. After receiving the notification, it will exchange data with it, and then the notification will start the process of shutting down the system.

②After receiving the notification, the user processes with the top-level window will be queried in turn to allow these user processes to exit. If a user process does not exit within a default timeout of 5000 milliseconds (the timeout time can be set by modifying the registry key value HKEY_CURRENT_USERControl PanelDesktop HungAppTimeout), Windows will display an end task dialog box to ask the user whether to end the task. By default, this dialog box will be displayed and will not be closed automatically.

For console programs, the basic situation is similar, except that Windows uses HKEY_CURRENT_USERControl PanelDesktop WaitToKillAppTimeout to set the timeout time.

③Then it is the turn to terminate the system process. System processes include, etc. When Windows terminates the system process, it does not prompt the user if it cannot terminate within the specified time, just like when it terminates the user process. Instead, it skips the process and executes the termination operation of the next system process. The timeout used is the same as the time used in step 2.