windows - 关闭窗口后运行应用程序

标签 windows

昨天我在 Windows7 计算机上运行了 BIOS 更新。 BIOS 更新工具执行了 Windows 关闭并且没有重新启动计算机(因此在 Windows 关闭后直接),一个类似 DOS 的工具启动更新了 BIOS。

我搜索了 WWW,但我所能找到的只是如何在 Windows 关闭时(因此在 Windows 关闭之前)或注销时(注销脚本)执行应用程序。

有没有人知道如何实现这一点?

最佳答案

我猜测机器实际上执行了软重启并正在运行 BIOS 代码。这是通常的方法,在某些情况下,用户可能看不到软重启,即 BIOS self 更新代码可能在 POST 之前运行。

但是,关闭后运行 Windows 代码是可能的(或者至少曾经是),尽管显然它的功能有限。可以在 Service Control Handler Function 上的 MSDN 库条目中找到关键信息。 :

After this time expires, system shutdown proceeds regardless of whether service shutdown is complete. Note that if the system is left in the shutdown state (not restarted or powered down), the service continues to run.

因此,至少在原则上,您需要做的就是安装一个服务,该服务请求关闭通知但在发生关闭时实际上并不停止,然后指示 Windows 关闭而无需重新启动或关闭电源。我确实看到过这种情况,但只发生在旧版本的 Windows 上(在关机时自动关机成为默认设置之前!)所以我不能保证它仍然有效,尽管它肯定有一次。

但是,应该注意的是,这不一定会给您提供您可能想到的那种环境。例如,设备驱动程序不一定在关机前卸载;毕竟,这有什么意义呢?

关于windows - 关闭窗口后运行应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12262656/

相关文章:

c - 打开USB通讯

windows - svnadmin load 子目录

Windows 上的 Python - 编译

Windows 'findstr' 命令 : Exclude results containing particular string

mysql - Django 1.11 : Issues with utf8 writing to file on windows

javascript - HTML5 放置目标支持哪些剪贴板格式?

windows - Win32 ToUnicode()/ToAscii() 输出的最大字符数

windows - 我应该使用 OLE 剪贴板机制还是标准剪贴板 API?

python - 使用 python subprocess.popen ..无法阻止 exe 停止工作提示

javascript - 监控间隔如何影响 ZeroMQ 中的网络流量 ~.1 [GB/s]?