Automatically Backup User Data in Windows XP

The script will automatically backup all the user files in My Documents, Desktop, Favorites, and the default PST location.

How to run a batch script: Save the below code in an *.CMD file. Replace FILESERVER with the name of your file server and ensure there is a share called “users” and inside a user that matches the username. The scripts will create a new folder called “AutoRecovered” and save all files to that location.

REM This script will automatically backup all user files in My Documents, Desktop,
REM Favorites, and the PST location.
REM NOTE ************************
REM Please check the computer for user saves files outside of the default locations
REM like the root of the C drive.
REM NOTE ************************
REM Source: http://www.computing.net/answers/dos/making-a-bat-file-to-get-input/12821.html
REM Source: http://wp.me/p6h4z-1g
ECHO *****************************
ECHO *** Automated User Backup ***
ECHO *****************************
set INPUT=
set /P INPUT=Please enter in the username to backup: %=%
if "%INPUT%"=="" goto input
ECHO Mapping to Network Drive with Domain Administrator Account
net use Z: \\FILESERVER\users\%INPUT% /User:DOMAINadministrator *
ECHO Creating AutoRecovered Directory in \FILESERVERusers%INPUT%
mkdir Z:\AutoRecovered
ECHO Copying "My Documents" for %INPUT%
xcopy "C:Documents and Settings\%INPUT%\My Documents" "Z:\AutoRecovered\My Documents" /s /c /h
ECHO Copying "Favorites" for %INPUT%
xcopy "C:Documents and Settings\%INPUT%\Favorites" "Z:\AutoRecovered\Favorites" /s /c /h
ECHO Copying "Desktop" for %INPUT%
xcopy "C:Documents and Settings\%INPUT%\Desktop" "Z:\AutoRecovered\Desktop" /s /c /h
ECHO Copying "Email PSTs" for %INPUT%
xcopy "C:Documents and Settings\%INPUT%\Local Settings\Application Data\Microsoft\Outlook\*.pst" "Z:\AutoRecoveredEmail" /s /c /h
ECHO Operation Complete
#microsoft #registry #windows