How to automatically back up files when the system is shut down?

  
        

Some of the files that are important to us are gone once they are turned off. This is a thing that bothers everyone. Therefore, every time we shut down, we need to save a variety of files, but there are still a lot of system status information will be missed, such as IE favorites, cookies, some application data and so on. So, can we let the system automatically back up these files for us every time we shut down?

In Windows 2000/XP, we can use the console to create shutdown scripts that will be executed in the background after you issue a shutdown command to automatically back up this important information.

Step 1 Click "Start", "Run", enter "mmc" and press Enter to start the console. Click File, Add/Remove Console Unit, click the Add button in the lower left corner from the pop-up dialog box, and select Group Policy from the available Independent Control Units. Click the "Add" button and then click the "OK" button to return to the console interface.

Step 2 In the "Local Computer" Policy under "Console Root Node" on the left side of the console interface, expand "Windows Settings", "Script (Startup/Shutdown)", and double-click the right window. In the "Shutdown", open the "Shutdown Properties" interface.

Step 3 Click the "Add" button in the "Shutdown Properties" interface to open the "Add Script" dialog box. We can name the script, such as "Backup.bat".

After the step 4 is set, click the "File" and "Save" commands to save the console for later adjustment. The next time you shut down, you will find that in the shutdown prompt window, in addition to the message "Shutdown...", the prompt "Running shutdown script" is displayed, indicating that the shutdown script is being executed.

Step 5 Now let's add content to the shutdown script file. Since we are doing data backups, using the XCOPY command is the easiest and most effective. For example, we want the contents of the favorites to be backed up to the mobile hard disk every time we shut down (assuming the mobile hard disk drive letter is F), then you can add such a command to the batch file:

XCopy "C :\\Documents and Settings\\Administrator\\ Favorites" F:\\Backuup\\Favorite /E /y

Parameter E means copying all subfolders; since the shutdown script does not provide any feedback when executed, the parameters Y is required. Otherwise, after finding the file with the same name, XCOPY will prompt whether to overwrite and the command will not be executed smoothly.

Hint: Be careful when making a shutdown script, be sure to ensure that it cannot be executed without user intervention. As long as one command fails or waits for user input, the following commands will not be executed. If you feel that using XCOPY is too much trouble, there is another trick: set up a scheduled task in the "Control Panel", set this task as one execution (you don't need to make an execution plan for it), and the task you perform is the file you need to back up. After saving this task, click the newly added task in "Control Panel", "Task Schedule", then right-click to select "Properties", copy the command line in the Properties window, and paste this command line into the batch file. Just fine.

Copyright © Windows knowledge All Rights Reserved