I have a problem, every few days my company restarts my workstation, and I keep losing work because of this. I opened a support ticket with the support team, but they have no idea how to stop it from happening (typical).

I know that they're not using the shutdown command to restart my PC, because running shutdown -a doesn't stop it from happening.

I was thinking maybe someone has made a "keep alive" app to stop anything from restarting my workstation, so that I can restart it myself when I'm ready to do so (i.e. after I've saved my work, etc). Because of the work I do (I'm a programmer) it's not always possible to save what I'm doing (e.g. if I'm in the middle of debugging something complicated).

Maybe I can intercept and block some sort of shutdown message in the winapi (though this discussion would me more suited to Stack Overflow).

  • Does it happen regularly? Is it Windows updates? Aug 31 '10 at 9:06
  • This is not caused by Windows updates. I'm not sure what application is causing my PC to restart - it could be the anti-virus. I was hoping there was something that could just block Windows from restarting. I believe that fixing the "root cause" is out of my hands. Aug 31 '10 at 11:52
  • 1
    If you unplug the network cable, does it still do it? It could be a remote administration system... Just trying to rule out things you can't control.
    – Signal
    Aug 31 '10 at 12:24
  • 1
    Have you checked the system event logs?
    – CarlF
    Aug 31 '10 at 12:31
  • You could write an app that stops it: msdn.microsoft.com/en-us/library/aa376876(VS.85).aspx
    – default
    Aug 31 '10 at 13:35

You could write the application yourself, and catch the WM_QUERYENDSESSION message.
This program apparently stops a system from going to Sleep, but I don't think that would suffice.

  • I will try it at least. Sep 2 '10 at 13:04
  • @nbolton: sweet :) I think that the author of the Insomniac program made the source available, so you could study that as well.
    – default
    Sep 2 '10 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.