New
#1
Batch File - List files modified within last 7 days
Hi All,
I'm trying to create a batch file that will create a text file listing all the files within a folder that has been modified within the last 7 days, i thought this was going to be easy using some kind of switch that looks at the modified date but that doesn't seem to exist and i can't figure a way of doing it.
i have this script that will list files older than 7 days:
and this cmd that will list all my files in in date order (newest first):Code:forfiles -p c:\ /s /m *.* /d -7 /c "cmd /c echo @file > c:\users\jdobbsy1987\desktop\list.txt"
But can't seem to get anything to list files modified within the last 7 days.Code:dir /s /o:-d
It would need to look in subdirectories too.
Any help would be greatly appreciated.
Regards,
JDobbsy1987