@echo off

if not exist "C:\Program Files\ZipGenius 6\zg.exe" c:\mrc\InstallZipGenius.bat


:: Extract the date and apply it to variables.
for /F "tokens=1-4 delims=/ " %%i in ('date /t') do (
    set DayOfWeek=%%i
    set Month=%%j
    set Year=%%k
)


md M:\MrC\%DayOfWeek%-%Month%-%Year%

robocopy \\mrcdb\database$ M:\MrC\%DayOfWeek%-%Month%-%Year% /e /z /r:3 /w:5 /mir

zip -r -S M:\MrC\%DayOfWeek%-%Month%-%Year%_MrC_DB.zip M:\MrC\%DayOfWeek%-%Month%-%Year%\*.*


:"c:\Program Files\ZipGenius 6\zg.exe" -add M:\MrC\%DayOfWeek%-%Month%-%Year%_MrC_DB.zip CB R1 F2 +"M:\MRC\%DayOfWeek%-%Month%-%Year%\*.*"

:SLEEP 5

:"c:\Program Files\ZipGenius 6\zg.exe" -sfx M:\MrC\%DayOfWeek%-%Month%-%Year%_MrC_DB.zip B1 O2 DM:\ A1

:SLEEP 5

RMDIR /S /Q M:\MrC\%DayOfWeek%-%Month%-%Year%

:DEL /Q M:\MrC\%DayOfWeek%-%Month%-%Year%_MrC_DB.zip


