Is there any API function for shutting down Windows while installing any pending updates?

↘锁芯ラ 提交于 2019-12-05 16:21:56

问题


I know the ExitWindowsEx() API function which simply shuts down Windows. But as far as I know, you cannot make Windows install any pending updates with it.

Is there any API support for installing any pending updates (in that standard blue screen which says "n of m updates have installed - Please don't turn off or unplug your PC, Windows will shut down itself") then shutting down Windows (equivalent to clicking the "Install updates and shutdown" menu option of the Windows user interface)?

(OS Version: Windows XP and higher.)


回答1:


The best you can do is call InitiateShutdown and include the SHUTDOWN_INSTALL_UPDATES flag on Vista and higher. Windows XP does not support programmatically shutting down with updates.



来源:https://stackoverflow.com/questions/14505648/is-there-any-api-function-for-shutting-down-windows-while-installing-any-pending

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!