Some of us want to make a regular backup of some important files (or run some other tasks) automatically every time when we shutdown the computer. You can do so easily in Windows 7 by utilizing the shutdown script feature. Here is how :
- First of all, create the command script (or a batch file) and save it. You should write the script as a batch file though the PowerScript is also supported. For example, if you want to make a backup of all the files in C:\Project to a network drive X:, then the script would be as follows :
Copy C:\Project\*.* X:\
We save the script file as C:\MakeBackup.bat.
- Press the key combination Windows logo key + R to open the Run dialog.
- In the Run Dialog, type gpedit.msc and press Enter to open the Group Policy Editor.
- In the Group Policy Editor, open Computer Configuration → Windows Settings → Scripts (Startup/Shutdown) as shown.
- Double-click on Shutdown in the right side pane. In the window that opens up, click on the Add button.
- Browse to your script file and put in any parameter (only if it accepts parameters). Then click OK button.
- Click OK to close the Shutdown Properties window.
That’s it. Now each time you shutdown the computer, the shutdown script that you have added will run automatically before the computer shuts down. You can add more than one script if you want.