Batch file for copying all files & sub-directories to another directory

2012-07-16


@ECHO OFF  
set path=C:\Windows\system32;path=%path%;

GOTO EndComment

=======================================================================================
SET "" in source & destination bcoz otherwise it won't take space in the folder location path
=======================================================================================

:EndComment

set varSource="H:\Source"
set varDestination="H:\Destination"

IF EXIST %varDestination% RMDIR %varDestination% /s /Q MKDIR %varDestination%  ELSE GOTO StartCopy

:StartCopy
XCOPY %varSource% %varDestination%  /Y /S /E /Q /R


pause

0 comments: