Robocopy – Move files and directory from one to another with exclusion


@ECHO OFF
SETLOCAL


SET _source="\\netapp\Home_Share\Transito"

SET _dest="\\netapp\Home_Share\TransitOLD"

SET _what=/COPYALL /SEC /E /Z /R:3 /W:2 /MOVE /XD "\\netapp\Home_Share\Transito\Test" "\\netapp\Home_Share\Transito\Prova" "\\netapp\Home_Share\Transito\ICT" "\\netapp\Home_Share\Transito\Produzione"

:: /COPYALL :: COPY ALL file info
:: /B :: copy files in Backup mode.
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree

SET _options=/R:0 /W:0 /LOG:MyLogfile2.txt /NFL /NDL
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging

ROBOCOPY %_source% %_dest% %_what%