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.

When a users logs out of their computer, I would like a way of displaying a message to them asking if they remembered to set their out of office and email forwarding, I'd like to give them the chance to cancel their logout if they need to go back in to Outlook and do this.

I have tried using a logout vbscript which traps the answer to a Yes / No question but the shell command "shutdown -a" doesn't work as I think the process is too far gone.

Is there a way to either customize the standard "Are you sure you wish to log off?" message showing the reminder or intercept the Start - Shutdown/ Log Off process? I am open to different ways of doing this, it doesn't have to be a vbscript.

My environment is Windows 2003 servers and Win XP Pro clients.

Thanks in advance.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You cannot stop a logoff that is already in process.

It might be possible to detect that the "Log Off Windows" window is open, but this is down the evil magic path. There is no way to do the same when the user runs logoff, rwinsta, shutdown, pulls the plug...


(When I click "Log off", I expect Windows to close the session. If the user has forgotten about this particular customization, he may accidentially leave it at the confirmation box, which someone else could cancel and then access the user's session, including files and running programs. On the other hand, this could be avoided by a very short timeout.)

share|improve this answer
    
From the state the computer is in when the logout script runs, I had a feeling there was no coming back from it. I don't really understand the purpose of "shutdown -a" then. –  Yeodave Mar 22 '11 at 16:21
    
@Yeodave: It's for aborting shutdowns scheduled with shutdown -s -t 42 (time is in seconds). –  grawity Mar 22 '11 at 16:27
    
Or just shutdowns that haven't gotten past some particular point. Slower computers or computers with a lot of apps running that must respond to the shutdown request can also be stopped with the shutdown -a regardless of whether or not the shutdown was initiated using shutdown -t... . –  music2myear Jun 22 '11 at 14:28

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.