Sure,
setlocal ENABLEDELAYEDEXPANSION
echo ┌╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨╨┐>> SyncLog.log
echo │ SYNC STARTED: %DATE% at %TIME% │>> SyncLog.log
echo ├─────────────────────────────────────────────┘>> SyncLog.log
for /F “skip=5 tokens=" %%A in (SyncConfig.txt) do (
for /F "tokens=3 delims= ,=, " %%B in (‘echo %%A^| findstr /i /c:“Source Drive”’) do (set SourceDrive=%%B)
)
for /F "tokens=6-10 delims= " %%A in (‘dir !SourceDrive!^| findstr /i Volume^| findstr /v Serial’) do (
set SourceDriveName=%%A %%B %%C %%D %%E
echo │ The source drive is set to !SourceDrive! ^(!SourceDriveName!^)>> SyncLog.log
)
for /F "skip=9 tokens=” %%A in (SyncConfig.txt) do (
for /F %%B in (‘echo %%A^| findstr /i /v /c:“Not Included”’) do (
if NOT EXIST %%B:\ (
call :GetTime
echo │ !CurrentTime! %%B:\ does not exist and was not synced>> SyncLog.log
)
if EXIST %%B:\ (
set NetworkDrive=FALSE
for /F “skip=5 tokens=2 delims= " %%C in (‘net use^| findstr /v command’) do (if “%%B:”==”%%C" (set NetworkDrive=TRUE))
if !NetworkDrive!==TRUE (
call :GetTime
echo ├ !CurrentTime! %%B:\ is a network drive and was not synced>> SyncLog.log
)
if !NetworkDrive!==FALSE (
title SYNCING !SourceDrive! TO %%B:
robocopy /MIR !SourceDrive! %%B:
title SYNC IS COMPLETE
if %ERRORLEVEL% GEQ 8 (
call :GetTime
echo █►!CurrentTime! An error occured when robocopy attempted to sync from !SourceDrive! to %%B:>> SyncLog.log
)
if %ERRORLEVEL% LSS 8 (
for /F "tokens=6-10 delims= " %%C in (‘dir %%B:^| findstr /i Volume^| findstr /i /v Serial’) do (
call :GetTime
echo ├►!CurrentTime! %%B:\ ^(%%C %%D %%E %%F %%G^) was successfully synced with !SourceDrive! ^(!SourceDriveName!^)>> SyncLog.log
)
)
)
)
)
)
endlocal
echo ├─────────────────────────────────────────────┐>> SyncLog.log
echo │ SYNC ENDED: %DATE% at %TIME% │>> SyncLog.log
echo └╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥╥┘>> SyncLog.log
goto :eof
:GetTime
set CurrentTime=%TIME%
goto :eof