Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to schedule a task to run at logoff but before windows sends the terminate signal to applications?

I need to pass a command to a running VirtualBox VM (host system being Windows8 pro) so the VM will close and save it's current state. Looking in Task Sheduler, i can't find a trigger for logoff (unless there is an journal entry i can link to, but then i didn't found it either). I tried using gpedit.msc but Group Policy scripts appear to run after the termination signal is sent. This causes windows to try and close my VM before the command handles it and brings me back to the desktop because VirtualBox won't auto-save the VM.

share|improve this question
Thanks. Yes, i didn't consider going the other way and using the script to shutdown but it's probably the easiest work-around. I'll wait to see if someone comes with another option than try to find out how to mark a post as answer. I don't see any button to do this. – r0k Feb 1 '13 at 11:49
Ok, I posted it as an answer instead, since you can't accept comments as answers. If you don't get a better solution you can accept it if you wish. – Karan Feb 1 '13 at 19:43
up vote 1 down vote accepted

I don't think this is possible. What you can do instead is create a batch file/script that executes your commands and finally initiates logoff (using shutdown.exe or something else).

Another option would be to use a program like Karen's Show Stopper, which essentially does the same thing:


share|improve this answer
Well, looke like there is no way to do what i wanted. This is an easy enough work-around. Thanks – r0k Feb 8 '13 at 10:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .