I would like to create a Windows batch script that allows me to write filenames of a given directory to a text file only if the modification date is of a specific month and a specific year.
For example, how can I print all the files modified in May 2018 of the C:\tmp directory?
At the moment I wrote this instruction:
FORFILES /P C:\tmp /C "cmd /c if @isdir==FALSE set [email protected]& (call echo @path) >> file.txt" >NUL 2>&1
I should add these conditions:
if %fdate:~3,2%==05 if %fdate:~6,4%==2018