|I would suggest researching alternative archive-attribute.|
My guess is that the "generic" templates would NOT have the "A" attribrute, and other templates would, but I might be totally wrong. If they do, you can use archive-bit much more easily than date-math (always a bitch). Then use batch to create list of all "A"-tagged files to retain.
If date-math is the only other option, call this batch "subdate" f/e::
:: subdate.bat: subtract ONE day from the input (or current if no input provided) date
:: valid inputs: (null=current), 0m-0d-yy, m-d-yy, 0m-d-yyyy, etc. (and all subst. -=/.)
:: setup to allow default of current date, or override
if "%1" equ "" (set d8=%date%) else (set d8=xxx %1)
for /f "tokens=2-4 delims=-/ " %%m in ("%d8%") do (
set mo= %%m
set day= %%n
set mo=%mo: 0=%+0
set /a day=%day: 0=%-1
if %day% equ 0 (
set /a mo-=1
call :!mo! 2>nul)
set /a yr-=1
set /a mo=12
set /a leap="yr%%4"
if %leap% equ 0 (set /a day+=1)
set /a day-=1
:: ------ end subdate
to use subdate routine, this will subtract 3 days by calling it successively:
for /L %%a in (1 1 %subt%) do (
for /f %%a in ('subdate !prev!') do set prev=%%a
echo today minus %subt%: %prev%
::---- end snippet
note that this is very slow for any significant numbers! vbscript is much better way to do datemath. If you want
that (vbscript) version, let me know.
If you want to go this miserable (batch) route, let me know and i'll help. I would seriously look into
the Archive-bit settings first.