Backup via Systemstate

@ECHO OFF

SET TMP_PATH=E:\_tmp
SET BACKUPDIR=E:\backups
SET REMOTEBKPDIR=\\10.0.0.199\backups$\backups\%COMPUTERNAME%\

SET bYEAR=%date:~6,4%
SET bMONTH=%date:~3,2%
SET bDATE=%date:~0,2%

mkdir %TMP_PATH%
del /Q %TMP_PATH%\systemstate_bkp.bkf
ntbackup backup systemstate /F "%TMP_PATH%\systemstate_bkp.bkf" /V:yes /M normal

mkdir %BACKUPDIR%\%bYEAR%
mkdir %BACKUPDIR%\%bYEAR%\%bYEAR%-%bMONTH%
"C:\Program Files\7-Zip\7z.exe" a -mx9 "%BACKUPDIR%\%bYEAR%\%bYEAR%-%bMONTH%\%bYEAR%_%bMONTH%_%bDATE%_%COMPUTERNAME%_BACKUP.7z" "%TMP_PATH%\systemstate_bkp.bkf"
del /Q %TMP_PATH%\systemstate_bkp.bkf
del /Q %TMP_PATH%

mkdir %REMOTEBKPDIR%\%bYEAR%
mkdir %REMOTEBKPDIR%\%bYEAR%\%bYEAR%-%bMONTH%
copy %BACKUPDIR%\%bYEAR%\%bYEAR%-%bMONTH%\%bYEAR%_%bMONTH%_%bDATE%_%COMPUTERNAME%_BACKUP.7z %REMOTEBKPDIR%\%bYEAR%\%bYEAR%-%bMONTH%\

exit