XCOPY allows for copying of files, directories, and sub directories.
/C ignore errors, and finish what can be done
/S copy everything including directories and subdirectories
/D only copy source files that are newer than the destination files (big time saver on the process)
/Y overwrite files without asking for confirmation
/I automatically create new directories on the destination, if new directories were created in source.
/E Copies directories and subdirectories, including empty ones. Same as /S, May be used to modify /T.
/R Overwrites read-only files.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/Y Suppresses prompting to confirm you want to overwrite.
@echo off
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"
set "YYYY=%dt:~0,4%"
set "YY=%dt:~2,2%"
set "MM=%dt:~4,2%"
set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%"
set "Min=%dt:~10,2%"
set "Sec=%dt:~12,2%"
set dd=%YY%-%MM%%DD%
set tt=%HH%-%Min%-%Sec%
set /p sekarep= : nama folder =
set A=C:\copy1
set B=C:\copy2
XCOPY %A%\*.* %B%\%sekarep%\%dd%\%tt%\ /Y /E /S /C /I