Run process during windows shutdown

点点圈 提交于 2020-01-07 01:30:53

问题


I have a Win32 service, that needs to run a .NET executable on service stop (for cleanup reasons). I recently discovered that the cleanup never happens on shutdown, because the process creation gets blocked by OS. Does anyone know a way to override this? Process, I am spawning is not invasive and should only run a fraction of a second.


回答1:


The only way I could find to do it was: pre-create a child process suspended, and them un-suspend it on shutdown.



来源:https://stackoverflow.com/questions/6753215/run-process-during-windows-shutdown

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