1.

Solve : Mind is blown, should be easiest batch file ever, but stumped.?

Answer»

Hello Everyone, thanks for your help in advanced.

This is blowing my mind, i cant find ANYTHING on google or any forums i have VISITED

All i NEED is a little batch file that will go through all the directories on a drive and list LIST all the files that over a year old.  Doesnt have to delete the files or move them at all, all i need is a list.

Why is this so difficult?  If you have a better way than a batch file please feel free to include it in a post.

THANKS!If you don't need this to be self contained in a batch, here is how I would do it:

Use the windows search feature to find the files over a year old. Once it is done, copy those files to a separate directory. Then open command prompt and go to that directory and type dir /b > files.txt. There you go. Now you have a list of all those files. You can the just delete that directory that you copied to when done. Quote from: Linux711 on November 04, 2011, 10:54:55 AM

If you don't need this to be self contained in a batch, here is how I would do it:

Use the windows search feature to find the files over a year old. Once it is done, copy those files to a separate directory. Then open command prompt and go to that directory and type dir /b > files.txt. There you go. Now you have a list of all those files. You can the just delete that directory that you copied to when done.

GREAT IDEA, the only problem is, this drive is almost full and its 6 tb.  I just started at this job as the FIRST IT person and no one has gone through these files in almost 8 years. So that would be a ton of copying.    Quote
i cant find ANYTHING on google

How hard did you look?

I Googled "list files older than date". This told me about the forfiles command. I next Googled for "forfiles" which got me the MICROSOFT documentation page. Included in the examples is this one liner.

Total TIME 2 minutes approx.

Code: [Select]forfiles /s /m *.* /d -365 /c "cmd /c echo path is at LEAST one year old."


Discussion

No Comment Found