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 get the file security information from the files in the
- :: SOURCE folders and add them to the appropriate files in the DESTINATION
- :: folders.
- @echo OFF
- ver | find "Version 6." > nul
- if %ERRORLEVEL% == 0 (
- REM Do OPENFILES to check for administrative privileges
- openfiles > nul
- if errorlevel 1 (
- color cf
- echo.Right-click on this file and select 'Run as administrator'.
- pause
- color
- exit /b 1
- )
- )
- REM Custom variables.
- set "TASKNAME=Fix Permissions"
- set "TASKNAME=Fix NAS1 Sec"
- set "SOURCE=\\NAS1\FreeNAS\J2897\Android\Apps\Installed"
- set "DESTINATION=J:\NAS1 Mirror\Android\Apps\Installed"
- 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 Fixing permissions . . .
- echo.
- echo SOURCE:%TAB%%TAB%%SOURCE%
- echo DESTINATION:%TAB%%DESTINATION%
- REM Main RoboCopy command.
- robocopy.exe "%SOURCE%" "%DESTINATION%" *.* /E /Copy:S /IS /IT /NS /NP /R:100 /W:30 /Z /LOG:"%LOGFILE%"
- 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