UPDATE.BAT

From: "W.L. Wolcott" <wlw@healthexcel.com>

I have 2 hard disks. My second disk is used for a backup of the first. My main concern is (naturally) with my data files. So, I created a batch file called UPDATE.BAT that uses xcopy to scour my C: drive for updated data files and back them to D:. If it finds "new" files that need to be backed up, it sends a record of them to UPDATE1.TXT that sits on my Desktop. When the batch finishes, it loads UPDATE1.TXT to Notepad for my viewing. So, anytime I want, I can double click update.bat (if it's on my Desktop) or access it from my Start Menu and then instantly view the report.

I have taken this info and recreated a batch file that will do the same process with a little more flexibility. If you would like to use this batch file, download it here. Instructions are included with the batch file.

@echo off

echo Be sure you have customized this batch file before you run it
echo for the first time.  Please refer to the README.TXT included
echo with this file for instructions.
echo.
echo If you have NOT customized this batch file, press Ctrl-C now.
echo Otherwise you may proceed...
echo.
pause

if "%1" == "" goto usage

echo The following files were backed up... > %2
echo. >> %2
echo ...from C:\ > %2
xcopy32 c:\*.* %1 /c /f /h /i /k /r /u >> %2
echo ...from C:\COBOL >> %2
xcopy32 c:\cobol\*.* %1cobol /c /d /e /f /h /i /k /r /u >> %2
echo ...from C:\DATA >> %2
xcopy32 c:\data\*.* %1data /c /d /e /f /h /i /k /r /u >> %2
echo ...from C:\M2 >> %2
xcopy32 c:\m2\*.* %1m2 /c /d /e /f /h /i /k /r /u >> %2
echo ...from C:\PROGRAM UTILITIES >> %2
xcopy32 c:\progra~4\*.* %1progra~4 /c /d /e /f /h /i /k /r /u >> %2
echo ...from C:\TOOLS >> %2
xcopy32 c:\tools\*.* %1tools /c /d /e /f /h /i /k /r /u >> %2
echo ...from C:\U >> %2
xcopy32 c:\u\*.* %1u /c /d /e /f /h /i /k /r /u >> %2
echo ...from C:\Z >> %2
xcopy32 c:\z\*.* %1z /c /d /e /f /h /i /k /r /u >> %2
echo.
echo SYSTEM & MISC FILES... >> %2
xcopy32 c:\win\*.dat %1RESCUE /c /f /h /i /r >> %2
notepad %2
goto end

:usage
echo You need to specify a backup destination path (this can be a drive
echo or a directory) and the name of the log file that will be created.
echo.
echo Usage:
echo  UPDATE.BAT [backup destination] [logfile]
echo.
echo Examples:
echo  UPDATE.BAT D:\ C:\UPDATED.TXT
echo  UPDATE.BAT D:\CDRIVE\ D:\CDRIVE\BACKUP.LOG
echo.
echo Note:
echo  Alway be sure to end the backup destination path with a backslash.
echo.
pause
goto end

:end

[ Return to the xcopy page ]