Run process during windows shutdown
Asked Answered
P

1

0

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.

Phagocyte answered 19/7, 2011 at 19:50 Comment(5)
Take a look on the following link: #849118. It describes how you can subscribe to process events.Fierce
@Klinger: I have absolutely no idea how is subscribing to process events going to help mePhagocyte
I missed that you meant OS shutdown. The following link describes how to run scripts on startup/shutdown, not sure if this will help but you never know. tutorial5.com/content/view/157/47Fierce
Also, the following SO question, that has no accepted answer, is similar to your question. #5217746Fierce
He says it's "impossible" and sugests the policy route, what is what that tutorial is about. There is also a policy to disable automatic closing of console and GUI apps. Follow link with instructions: technospot.net/blogs/…Fierce
P
1

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

Phagocyte answered 22/8, 2011 at 17:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.