How can I run a script at shutdown time?

A. There is no direct way to accomplish this, however it is possable to write a script and then call the shutdown.exe utility that is shipped with the NT Resource kit

shutdown /l /y

You could then add a shortcut to this script on the desktop. An alternative is to use a utility called ShutUp which can be downloaded from .

You may also consider ShutdownPlus ( which replaces the standard Windows shutdown and logoff dialog boxes. Shutdownplus allows you to run applications and stop services (stopping services only under NT/2000) at shutdown, restart, or logoff.

Another method is to use a special GINA from which enables you to do this.

In Windows 2000 this can be accomplished using Group Policy Objects. Go to the User Configuration - Windows Settings - Scripts (Logon/Logoff) and set the Logoff option.

Click here to view image

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.