Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Released under the GNU General Public License version 3 by J2897.
- :: This script will copy everything in the SOURCE folders in the DESTINATION folders. The timestamps will be preserved. The security permissions will be discarded.
- :: Note: Files that already exist in the DESTINATION may be overwritten.
- @echo OFF
- REM Custom variables.
- set "TASKNAME=Migrate NAS1"
- set "SOURCE=\\NAS1\FreeNAS"
- set "DESTINATION=J:\NAS1\FreeNAS"
- REM Fixed variables.
- set "LOGFOLDER=%USERPROFILE%\RoboCopy Logs"
- set "LOGFILE=%LOGFOLDER%\%TASKNAME%.log"
- set "TAB= "
- REM Preparation.
- title %TASKNAME%
- pushd "%~dp0"
- if not exist "%LOGFOLDER%" (md "%LOGFOLDER%")
- REM Display.
- echo Copying . . .
- echo.
- echo SOURCE:%TAB%%TAB%%SOURCE%
- echo DESTINATION:%TAB%%DESTINATION%
- REM Main RoboCopy command.
- robocopy.exe "%SOURCE%" "%DESTINATION%" *.* /E /NP /R:100 /W:30 /Z /LOG:"%LOGFILE%" /XJ /XD "J:\$RECYCLE.BIN" "J:\System Volume Information" /XF "desktop.ini"
- REM Finish up.
- explorer /select,"%LOGFILE%"
- popd
- echo.
- pause
- :End
- echo.
- echo Ending . . .
- timeout /t 4 /nobreak >nul
- exit /b 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement