Using the ported Linux command date, you can get the date from the current date minus X days. I am trying to loop 1-30 days which will generate dates, then use those dates in a findstr. It seems that the loops work by themselves but when combined the inner for loop does not use the value X and date does not getr set. Anybody know what I'm doing wrong???!
for /L %%x in (1,1,%SEARCHDAYS%) DO (
set date1=
for /f "delims=" %%a in ('date.exe --date "Now -%%x days" +%%-m/%%-d/') do @set date1=%%a
echo "%date1%"
findstr /c:"%date1%" file.txt
)
)