Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 that Windows 7 can remind me (with a dialog box for example) to complete some particular tasks before shutting down, such as locking my secret files and logging out from some services?

share|improve this question
up vote 3 down vote accepted

If you have logon auditing enabled (which you can do from the Security Policies management console, secpol.msc), you can use the event viewer to find the event for user logoff or system shutdown. Then, you can click on "create a task for this event" and create a task that displays the desired message. As mentioned in the comments, you could also use a logoff or shutdown script.

If you were to use a logoff script, you would want to create the script, most likely using VBscript, and then use group policy settings (gpedit.msc) to set it up. The main function you'll be looking at is MsgBox, which displays a standard Windows message box with whatever text, buttons, icons, etc. you want.

This is just an example, which shows a warning-style box with a single OK button. For full documentation, see the MSDN article on MsgBox.

MsgBox "Please make sure to clean up after yourself before logging off. Have you done everything?",48,"Clean up"

...which gives you

Clean up warning

share|improve this answer
+1 He could use a user logoff script or a shutdown scipt as an alternative. – paradroid Oct 14 '10 at 21:43
Indeed, that would work as well. – nhinkle Oct 14 '10 at 23:07
Hmmm, logoff or shutdown script, does that mean i have to write .bat file or are there other ways to do this work... (I only know about .bat files) – Unknown Oct 15 '10 at 3:09
It would be better to use a VBscript, since those can create messages. I'll edit my post to include an example. – nhinkle Oct 15 '10 at 3:12
FYI secpol.msc isn't included with Win7 Home Premium or less. – stentor Feb 3 '13 at 20:24

Go to Windows Task Scheduler, and create a task. In the Triggers section, click New... and in the Begin a Task... drop-down, select the option that works best for you.

There a lot of different options etc. to choose from. Enjoy!

share|improve this answer
Hi Josh, Thanks for the wonderful option, but i can't see any shutdown trigger there.. Can you please explain more if there is any of that option – Unknown Oct 14 '10 at 15:50
Good point. I don't see any "shutdown" option either. Perhaps you could create a task that gets triggered using the Lock function that does the things that you want, and then executes a shutdown when complete. So instead of explicitly shutting down your PC, just click the Lock instead. – Joshua Oct 14 '10 at 21:17

Your Answer


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.