How can I run a script at shutdown time?

John Savill

April 6, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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 http://www.zdnet.com/pcmag/download/utils/shutup-a.htm .

You may also consider ShutdownPlus (http://www.wmsoftware.com/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 http://wwwthep.physik.uni-mainz.de/~frink/nt.html 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

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like