DOS Batch file to find "new" files by date

Posted by Todd McArthur on Super User See other posts from Super User or by Todd McArthur
Published on 2011-08-21T16:16:50Z Indexed on 2012/11/20 11:09 UTC
Read the original article Hit count: 241

My PC has entered an infinite BSOD loop - but I do have access to a safe-mode command prompt.

I'm trying to get an idea of "what changed" that might have triggered this. e.g. I might have gotten a virus, or an app update went belly up.

I'd like to thus see which files were created/modified in the last few days/week or at least the *.exe, *.dll, *.com, *.bat etc.

I thought I was ok with my Batch-fu but I'm stumped on how to write a quick batch file/command that would list the files for me.

REM This will find the files, but the results are all muddled
REM all EXE files, reverse sort by date, recursively through sub-directories

dir *.exe /O-D /S

What I'd really like is to find all (executable filetypes) that were created/modified in the last 3-7 days.

Can anyone point me in the right direction?

© Super User or respective owner

Related posts about command-line

Related posts about batch