Simple backup script for Windows XP and other Windows Systems
ARE YOU BACKING UP YOUR DATA?
Have you ever wanted to automate a backup to a network share? If so, here’s an easy script to do just that. Copy the cope below and save it as backup.bat to your c:\ – then run the file so it copies from %1 to %2 – you can call it like this cmd -> backup.bat c:\ \\your-network-share – that would copy all the files to a network share from your C:\ drive. You can use a mounted USB drive as well as the destination drive if you want…. Personally, I use the switch “/E /D /R /H /C /Y /I” since I only want newer files and want to suppress the prompts to create new directories, etc. enjoy!
@echo off
rem COPYIT.BAT transfers all files in all subdirectories of
rem the source drive or directory (%1) to the destination rem drive or directory (%2)xcopy %1 %2 /E /D /R /H /C /Y /I
if errorlevel 4 goto lowmemory
if errorlevel 2 goto abort
if errorlevel 0 goto exit:lowmemory
echo Insufficient memory to copy files or
echo invalid drive or command-line syntax.
goto exit:abort
echo You pressed CTRL+C to end the copy operation.
goto exit:exit
