Link to home
Start Free TrialLog in
Avatar of Lia Nungaray
Lia NungarayFlag for United States of America

asked on

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!
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.
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
I said this because "filter for date" usually means something like "the last 5 days".
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.
Avatar of Lia Nungaray

ASKER

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!
Avatar of Bill Prew
Bill Prew

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
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?