rem *** Backup sources to archive ***
@echo off
rem *** Archive general settings ***
set source=d:\Projects\
set target=%CD%
set archive_prefix=Projects
set archive_ext=.7z
set packer_dir=d:\Projects\quadarax\qdr.fnd\Assets\Tools

rem obtain datetime parts
set CUR_YYYY=%date:~10,4%
set CUR_MM=%date:~4,2%
set CUR_DD=%date:~7,2%
set CUR_HH=%time:~0,2%
if %CUR_HH% lss 10 (set CUR_HH=0%time:~1,1%)
 
set CUR_NN=%time:~3,2%
set CUR_SS=%time:~6,2%
set CUR_MS=%time:~9,2%

set SUBFILENAME=%CUR_YYYY%%CUR_MM%%CUR_DD%-%CUR_HH%%CUR_NN%%CUR_SS%

set archive_full=%target%%archive_prefix%_%SUBFILENAME%%archive_ext%

%packer_dir%\7z.exe a -xr!bin -xr!obj -xr!.vs -xr!.git %archive_full% %source%

echo %archive_full% created