You are not logged in.

#1 09 Oct 2007 16:47

overburn
Member
Registered: 09 Oct 2007
Posts: 1

Need to go back 90 days only

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

#2 10 Oct 2007 09:53

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Need to go back 90 days only

Instead of DIR try Robocopy /L /maxage:90

Offline

Board footer

Powered by