windows定时关机程序
When you shut down your computer, Windows doesn’t shut down immediately. Instead, it gives running applications and services some time to close first. You can control how long Windows waits—and whether it automatically closes running applications or not.
关闭计算机时,Windows不会立即关闭。 相反,它为运行中的应用程序和服务提供了一些时间以使其先关闭。 您可以控制Windows等待的时间,以及是否自动关闭正在运行的应用程序。
You shouldn’t normally need to change these settings, but it can be helpful if you’d like to force your computer to shut down more quickly. Some applications may also mess with these settings when you install them, and you might want to reset them to the default values if your shutdown process seems slow.
通常,您不需要更改这些设置,但是如果您想强制计算机更快地关机,则可能会有所帮助。 安装它们时,某些应用程序也可能会与这些设置混淆,如果关闭过程看起来很慢,则可能需要将它们重置为默认值。
更改桌面应用程序的等待时间 (Change the Wait Time for Desktop Applications)
There are three registry settings that control what Windows does with running applications when you shut down your computer:
关闭计算机时,有三种注册表设置可控制Windows对正在运行的应用程序执行的操作:
WaitToKillAppTimeout: When you shut down your PC, Windows gives open applications 20 seconds to clean up and save their data before offering to close them. This value controls how many seconds Windows waits for.
WaitToKillAppTimeout :当您关闭PC时,Windows会在打开关闭的应用程序之前提供20秒的时间来清理并保存其数据。 该值控制Windows等待多少秒。
HungAppTimeout: Windows considers applications “hung” if they don’t respond within 5 seconds and gives you a “force shut down” option. This value controls how many seconds Windows waits before considering applications unresponsive.
HungAppTimeout :如果Windows应用程序在5秒钟内未响应,则Windows 会将其视为“挂起”,并为您提供“强制关闭”选项。 此值控制Windows在考虑应用程序无响应之前等待的秒数。
AutoEndTasks: Windows normally displays an “force shut down” button after the number of seconds expires, asking for your permission to close any running applications. If you enable this option, Windows will instead automatically close any applications and shut down without your input.
AutoEndTasks :在秒数到期后,Windows通常会显示一个“强制关闭”按钮,要求您关闭所有正在运行的应用程序。 如果启用此选项,则Windows会自动关闭所有应用程序并在没有您输入的情况下关闭。
Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.
标准警告:注册表编辑器是一个功能强大的工具,滥用它会使您的系统不稳定甚至无法运行。 这是一个非常简单的技巧,只要您按照说明进行操作,就不会有任何问题。 也就是说,如果您以前从未使用过它,请在开始之前考虑阅读有关如何使用注册表编辑器的信息 。 并在进行更改之前一定要备份注册表 (和您的计算机 !)。
To change these settings, you’ll need to use the Registry Editor. To open it, press Windows+R on your keyboard, type “regedit”, and press Enter.
要更改这些设置,您需要使用注册表编辑器。 要打开它,请按键盘上的Windows + R,输入“ regedit”,然后按Enter。
Navigate to the following key in the left pane of the registry editor window:
导航到注册表编辑器窗口左窗格中的以下键:
HKEY_CURRENT_USER\Control Panel\Desktop
Check to see if you have any of the “WaitToKillAppTimeout”, “HungAppTimeout”, or “AutoEndTasks” settings in the right pane. If you don’t see them, Windows is using the default settings.
检查右窗格中是否具有“ WaitToKillAppTimeout”,“ HungAppTimeout”或“ AutoEndTasks”设置。 如果您没有看到它们,则Windows正在使用默认设置。
To create one of these settings, right-click the “Desktop” key in the left pane and select New > String Value. Name it “WaitToKillAppTimeout”, “HungAppTimeout”, or “AutoEndTasks”—whichever setting you want to customize. Repeat this process to add a second one or even all three.
要创建这些设置之一,请右键单击左窗格中的“桌面”键,然后选择“新建”>“字符串值”。 将其命名为“ WaitToKillAppTimeout”,“ HungAppTimeout”或“ AutoEndTasks”,无论您要自定义哪个设置。 重复此过程以添加第二个或全部三个。
To configure the WaitToKillAppTimeout
value, create the string value and double-click it. Enter a value in milliseconds. For example, the default value is “20000”, which is 20000 milliseconds or 20 seconds. If you wanted to set it to 5 seconds, you’d enter “5000”.
要配置WaitToKillAppTimeout
值,请创建字符串值,然后双击它。 输入以毫秒为单位的值。 例如,默认值为“ 20000”,即20000毫秒或20秒。 如果要将其设置为5秒,请输入“ 5000”。
We don’t recommend setting this value too low, as applications do need time to clean up. As a rule of thumb, don’t set it below 2000, or 2 seconds.
我们不建议将此值设置得太低,因为应用程序确实需要时间进行清理。 根据经验,请勿将其设置为2000或2秒以下。
To configure the HungAppTimeout
value, create the string and double-click it. Enter a value in milliseconds. For example, the default value is “5000”, which is 5000 milliseconds or 5 seconds. If you wanted to set it to 3 seconds, you’d enter “3000”.
要配置HungAppTimeout
值,请创建字符串并双击它。 输入以毫秒为单位的值。 例如,默认值为“ 5000”,即5000毫秒或5秒。 如果要将其设置为3秒,请输入“ 3000”。
We don’t recommend setting this value too low, or Windows will think applications are unresponsive when they aren’t. As a rule of thumb, don’t set it below 1000, or 1 second.
我们不建议将此值设置得太低,否则Windows会认为应用程序没有响应时无响应。 根据经验,请勿将其设置为1000或1秒以下。
To configure the AutoEndTasks
value, create the string and double-click it. Set it to “1” if you want Windows to automatically close programs at shutdown. The default value is “0”, which means Windows won’t automatically close programs at shutdown.
要配置AutoEndTasks
值,请创建字符串并双击它。 如果希望Windows在关机时自动关闭程序,请将其设置为“ 1”。 默认值为“ 0”,这表示Windows在关闭时不会自动关闭程序。
Be careful to save your work in any running programs before you shut down if you tell Windows to automatically close open programs. You could lose any open work when Windows abruptly forces programs to close at shutdown.
如果您告诉Windows自动关闭打开的程序,请在将其保存在任何正在运行的程序中之前小心保存。 当Windows突然强制关闭程序时,您可能会丢失任何打开的工作。
To undo a change, locate the WaitToKillAppTimeout
, HungAppTimeout
, or AutoEndTasks
values in the right pane. Right-click the option and select “Delete” to remove it. Windows will use the default setting instead.
要撤消更改,请在右窗格中找到WaitToKillAppTimeout
, HungAppTimeout
或AutoEndTasks
值。 右键单击该选项,然后选择“删除”将其删除。 Windows将改用默认设置。
后台服务 (Background Services)
Windows only offers one registry setting that controls what Windows does with background system services when you shut down your computer:
Windows仅提供一种注册表设置,用于控制关闭计算机时Windows对后台系统服务的作用:
WaitToKillServiceTimeout: Windows normally waits 5 seconds for background services to clean up and close when you tell your computer to shut down. Some applications may change this value when you install them, giving their background services extra time to clean up. Windows forcibly shuts down background services after this period of time. This value controls how many seconds Windows waits before doing so. Windows will automatically shut down if all services close successfully before the timer expires.
WaitToKillServiceTimeout :当您告诉计算机关闭时,Windows通常会等待5秒以清理和关闭后台服务。 一些应用程序在安装时可能会更改此值,从而使它们的后台服务有更多的时间来清理。 Windows在这段时间后强行关闭后台服务。 此值控制Windows等待多少秒。 如果所有服务在计时器到期之前成功关闭,则Windows将自动关闭。
To change this setting, you’ll need to use the Registry Editor. To open it, press Windows+R on your keyboard, type “regedit”, and press Enter.
要更改此设置,您需要使用注册表编辑器。 要打开它,请按键盘上的Windows + R,输入“ regedit”,然后按Enter。
Navigate to the following key in the left pane of the registry editor window:
导航到注册表编辑器窗口左窗格中的以下键:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Locate the WaitToKillServiceTimeout value in the right pane. If you don’t see it, right-click the “Control” key in the left pane, select New > String Value, and name it “WaitToKillServiceTimeout”.
在右窗格中找到WaitToKillServiceTimeout值。 如果看不到,请右键单击左窗格中的“ Control”键,选择“新建”>“字符串值”,并将其命名为“ WaitToKillServiceTimeout”。
Double-click the WaitToKillServiceTimeout
value and enter a number of milliseconds. The default is 5000 milliseconds, or 5 seconds. To set it to 20 seconds, you’d enter “20000”.
双击WaitToKillServiceTimeout
值,然后输入毫秒数。 默认值为5000毫秒,即5秒。 要将其设置为20秒,请输入“ 20000”。
You shouldn’t set a value too low or background services won’t be able to shut down properly. As a rule of thumb, don’t set this value below “2000”, or 2 seconds.
您不应将值设置得太低,否则后台服务将无法正确关闭。 根据经验,请勿将此值设置为低于“ 2000”或2秒。
To undo this change, return here and double-click the WaitToKillServiceTimeout
option. Set it to “5000”, the default setting.
要撤消此更改,请返回此处,然后双击WaitToKillServiceTimeout
选项。 将其设置为“ 5000”,默认设置。
翻译自: https://www.howtogeek.com/282062/control-how-long-windows-waits-before-killing-apps-at-shutdown/
windows定时关机程序