ต้องอาศัย tool ที่ชื่อ robocopy แล้วก็มี parameter ด้วย เช่น
robocopy.exe "D:\Dept\" "Q:\" /XF autorun.inf /E /copy:datso /R:10 /W:30 /log+:logback.txt
คือ copy ต้นทางจาก D:dept\ ไปที่ Q:\
/XF file [file] Excludes files with the specified names, paths, or wildcard characters.
/E Copies all subdirectories (including empty ones).
/COPY:copyflags Copies the file information specified by copyflags, which can be any combination of the following :
D – file Data. S – file Security (NTFS ACLs).
A – file Attributes. O – file Ownership information.
T – file Timestamps. U – file aUditing infomation.
Source and destination volumes must both be NTFS to copy Security, Ownership or Auditing information.
If no this switch is omitted the default is /COPY:DAT, or /COPY:DATS if /SEC is specified..
/R:n Specifies the number of retries on failed copies. (The default is 1 million.)
/W:n Specifies the wait time between retries. (The default is 30 seconds.)
/LOG+:file Redirects output to the specified file, appending it to the file if it already exists.