The Windows shutdown script : easy, step by step instructions

Do you use a Windows shutdown script ? Since the introduction of Windows 2000 you can program your computer to perform certain tasks on special events.

Suppose for instance that you want to make a backup copy of a certain important file automatically each time you power-off your machine. Or you want to make a backup of all your emails and contacts in Outlook or Outlook Express.

There is practically no limit to the functionality of startup/shutdown scripts. If you can put it in a script, you can use it in a startup or shutdown script. There are four script types that you can use : shutdown, startup, logon and logoff script.

You can write scripts in any language the operating system supports. For example, you can continue to use batch files or write Windows Script Host (WSH) scripts in VBScript or Microsoft JScript. You can also use the new Extensible Markup Language (XML)-based Windows Script (.ws) file.

The execution order for these scripts is pretty straightforward. Windows runs startup scripts when it starts and shutdown scripts, well, when it shuts down. You can even create multiple scripts for each event (startup, shutdown, logon and logoff). The scripts will then be executed in the order that they appear in the scripts properties dialog box.

You can access network drives from startup and shutdown scripts. That's because startup scripts run after the computer initializes network connections and shutdown scripts run before the computer deletes network connections.

Windows shutdown script example

Suppose, for this example's sake, that you want to make a backup copy of your entire directory c:\importantdir to a network drive called Z:\ via a shutdown script.

First off, let's create a new file copyimportantdir.bat with the following copy command :

Copy c:\importantdir\*.* Z:\

And save the file in c:\importantdir

Next, you need to invoke the group policy editor. To do that :

Windows opens up the Group Policy editor.

If you are curious where you can add logon/logoff scripts, they are in the Group Policy editor under User Configuration->Windows Settings->Scripts (Logon/logoff)

Return from "Windows shutdown script " to the previous page.

Add to My Yahoo! Add to My MSNAdd to Google