Delete files using DOS

I have a folder that takes forever to render. I need to start deleting files before the drive fills up. I was hoping to use DOS to accomplish this. Is there a way to display files on the command window and filtering them out by created date? Thanks!
horaliaAsked:
Who is Participating?
 
knightEknightCommented:
What kind of filter?

You can filter by specific date like this:

  dir  *.*  | find "05/10/2011"

or by specific month:

  dir  *.*  |  findstr  "05/../2011"

0
 
knightEknightCommented:
But first, you would of course need to navigate to the folder where your files are stored.  In the command prompt do this:

  CD/D  "C:\My Folder\My Sub Folder"

replace  C:  with the drive letter and  My Folder  with the actual path.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You can't filter for date by default. However, you can at least sort by date:
   dir /o:-d /t:c /p
/t:c will use and disply creation date (vs. modification date), and /o:-d will sort descending after date. /p will pause after each page.
If you want ascending sort for date, use /o:d instead.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
n2fcCommented:
1) Open a command prompt
2) CD to directory in question
3) Use:    dir /od   to sort directory by date
4) Use:    dir /od /tc as above, but use CREATION date
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I said this because "filter for date" usually means something like "the last 5 days".
0
 
knightEknightCommented:
If you need to DELETE based on date, there is no direct way, but a solution can certainly be scripted out.  Just let us know what it is you need done.  Please provide more details like the filename format, the exact path, the number of files, how many to delete, and based on what criteria, etc.
0
 
horaliaAuthor Commented:
What I'm ending up doing, is moving them to another folder, then emptying that folder.... Of course, this is a very cumbersome process. There are over 750,000 on the folder, file names have no rhyme or reason, so I would like to delete the oldest ones. I have a bunch that were created on 11/18/2011. Path is E:\Image. Thanks!
0
 
Bill PrewCommented:
If you don't mind using a small free command line utility, take a look at DELAGE32:

http://home.mnet-online.de/horst.muc/win/delage.htm
http://home.mnet-online.de/horst.muc/wbat32.htm

~bp
0
 
Lionel MMSmall Business IT ConsultantCommented:
So do you want something that will look at the creation date, such as 11/18/2011 and then delete it or do you want to have something that determines what the oldest creation daea is and then delete all the files created on that date?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.