This is my first post on here, i've started an apprenticeship and one of my first tasks is to make a script in batch to check if the last modified date of some files correspond to the current date.
If it corresponds, it saves the output into a txt file called test.txt with this part
:correct
echo. >> C:\Users\mmi\Desktop\test.txt
echo %date% >> C:\Users\mmi\Desktop\test.txt
forfiles /P C:\Users\mmi\Desktop\batch\qvtests /M *excel.xlsx* /C "cmd /c echo @file @fdate @ftime" >> C:\Users\mmi\Desktop\test.txt
forfiles /P C:\Users\mmi\Desktop\batch\qvtests\dossier /M *.txt* /C "cmd /c echo @file @fdate @ftime" >> C:\Users\mmi\Desktop\test.txt
If it doesn't correspond it would generate a new txt file called error_X.txt each time.
:error
echo. >> C:\Users\mmi\Desktop\erreur.txt
echo %date% >> C:\Users\mmi\Desktop\erreur.txt
forfiles /P C:\Users\mmi\Desktop\batch\qvtests /M *excel.xlsx* /C "cmd /c echo @file @fdate @ftime" >> C:\Users\mmi\Desktop\erreur.txt
My question is how can i check wether the last modified date corresponds or not ? I've read countless topics but I just can't understand how to adapt their code to my situation
Thanks for helping me !!