I need to display files between 2 dates (e-g. dates 23-sep-2012 to 30-sep-2012) in a folder using a batch script.
There are approximately a half million files in the folder.
How can I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Working with file timestamps is a pain in batch. The easiest solution is to use WMIC.
Here is a simple script that will do what you want. It can easily be modified to use CreationDate instead of LastModified date. You can also add and subtract additional columns to the output. Type
wmic datafile get /?to get a list of available columns (remove the spaces from the names). The output can be piped to SORT if you want the results sorted by date.The dates must be specified in YYYYMMDD format.
Sample usage – list files in current directory between 07-SEP-2012 and 17-SEP-2012
Sample usage: List files in temp directory between 26-SEP-2012 and 27-SEP-2012 sorted by last modified date in ascending order