You are not logged in.
Pages: 1
Hello,
I use a batch file list to all files and folders by date with the newest file/folder listed first. But, the batch file goes back in time too far, it lists everything. I need to narrow it down, I need to only go back 90 days, it has to stop listing after it reaches files/folders from the last 90 days.
This is the batch file I use:
cd\
C:
dir /a: /o:g-d > C:\Win_Recent.txt
cls
cd\
cd C:\Windows
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd C:\Windows\System
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd C:\Windows\System32
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd C:\Windows\System32\Drivers
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd C:\Windows\Tasks
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd "C:\Program Files"
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd "C:\Program Files\Common Files"
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd "%USERPROFILE%\Application Data"
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd "C:\Documents and Settings\All Users\Application Data"
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd
cd "%USERPROFILE%\Start Menu\Programs\Startup"
dir /a: /o:g-d >> C:\Win_Recent.txt
cls
cd\
cd "C:\Documents and Settings\All Users\Start Menu\Programs\Startup"
dir /a: /o:g-d >> C:\Win_Recent.txt
start C:\Win_Recent.txt
cls
What command(s) should be added that will allow files/folders to be listed only from the last 90 days? Thank you.
Last edited by overburn (09 Oct 2007 16:48)
Offline
Instead of DIR try Robocopy /L /maxage:90
Offline
Pages: 1