Submitted By: Vic Laurie

Copies files that are new or changed from a folder (and its subfolders) to a backup folder.

Visual Basic
Edit|Remove
@echo off
setlocal
set /p source="Enter full path of source folder enclosed in quotes: "
If not exist %source% (echo The folder you entered does not exist. Program will exit. & endlocal & pause & exit)
set /p backup="Enter backup folder path enclosed in quotes: "
If not exist %backup% (md %backup% & echo Created %backup%)
xcopy %source%\*.* %backup% /e /q /r /h /d /k /c /y /i
endlocal
echo backup finished
pause
exit