Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
2  
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
add comment

1 Answer

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:

1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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