10

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?

2 Answers 2

7

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

5
  • 1
    +1 He could use a user logoff script or a shutdown scipt as an alternative.
    – paradroid
    Oct 14, 2010 at 21:43
  • Indeed, that would work as well.
    – nhinkle
    Oct 14, 2010 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) Oct 15, 2010 at 3:09
  • 1
    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, 2010 at 3:12
  • FYI secpol.msc isn't included with Win7 Home Premium or less.
    – stentor
    Feb 3, 2013 at 20:24
0

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!

2
  • 3
    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 Oct 14, 2010 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, 2010 at 21:17

You must log in to answer this question.

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