本文介绍了Windows关闭期间运行进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Win32服务,该服务需要在服务停止时运行.NET可执行文件(出于清理的原因).我最近发现,清理永远不会在关闭时发生,因为进程创建会被OS阻止.有谁知道一种替代此方法的方法?过程中,我正在产卵不是侵入性的,应该只运行一秒钟的时间.
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.
推荐答案我能找到的唯一方法是:预先创建一个挂起的子进程,然后在关闭时将其取消挂起.
The only way I could find to do it was: pre-create a child process suspended, and them un-suspend it on shutdown.
更多推荐
Windows关闭期间运行进程
发布评论