@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
Mainly serves as my backup reference on programming & technology. Plus some random thoughts
- HOME
- PROGRAMMING
- TECHNOLOGIES
- GENERAL
- ABOUT ME
Batch file for copying all files & sub-directories to another directory
2012-07-16
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment