How do I delete a SHIT TON of files in Windows??

Discussion in 'OT Technology' started by 95vr4, Jan 3, 2009.

  1. 95vr4

    95vr4 OT Supporter

    Joined:
    Oct 6, 2004
    Messages:
    2,513
    Likes Received:
    0
    Location:
    Weddington, NC
    Hmmm....something's obviously screwed up here :ugh: (and it's still counting as we speak)
    [​IMG]

    Turns out there's a bug in the mail server that's created an extra ".mai" file for every email the server's sent the last 3 years :hsugh:. Downloaded and installed their hotfix to take care of the problem, now I gotta clean up though. Need to delete all .mai files in a directory, > a million at least.

    So Windows Explorer is out of the question obviously,

    I tried
    del c:\directory\*.mai
    but got impatient after 2 hours sitting there wondering if it was even doing anything :o

    What's the easiest way to delete them? I've never dealt with anywhere near this many files before.
     
  2. trouphaz

    trouphaz New Member

    Joined:
    Sep 22, 2003
    Messages:
    2,666
    Likes Received:
    0
    try deleting in chunks? maybe "del c:\directory\a*.mai" and then b*.mai and then c*.mai.... or if the names won't work well like that, find some combination that will.
     
  3. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    You may find it easier to copier everything but those files to a different folder, zap the folder and put everything back.
     
  4. r00tman

    r00tman Archiver of LOLs

    Joined:
    Sep 23, 2002
    Messages:
    1,989
    Likes Received:
    0
    Location:
    Toronto, ON █♣█
  5. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    If they were just created, you may be able to sort by date, and just mass delete. Otherwise, I'd delete them with a regex pattern. I don't think Windows supports regex patterns for delete, so you may need to install cygwin or other software.
     
  6. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    It sounds like something is trying to use those files still. Reboot into Safe Mode (hit F8 repeatedly after the BIOS screen), then open a DOS window and type "del c:\folder\*.mai /f /q /s". The "/f /q /s" will tell it to force-delete the files, not ask you about each one, and check all subfolders for *.mai as well. (If you don't want it to check subfolders, remove the "/s".

    It will probably take a long time if you have 3GB of tiny files. Do it before you leave work one evening; it should be done in the morning.
     
  7. trouphaz

    trouphaz New Member

    Joined:
    Sep 22, 2003
    Messages:
    2,666
    Likes Received:
    0
    i don't think he has any reason to think that something has them open. i think he's just being impatient. it is going to take a very very long time to delete all of those files. like deus says, just start it at night and check it in the morning.
     
  8. EkriirkE

    EkriirkE Zika Xenu OT Supporter

    Joined:
    Jan 11, 2004
    Messages:
    14,799
    Likes Received:
    0
    Location:
    Dublin & San Francisco, CA
    :were: windows has to first find every matching file before it begins deleting them... Even in DOS
     
  9. 95vr4

    95vr4 OT Supporter

    Joined:
    Oct 6, 2004
    Messages:
    2,513
    Likes Received:
    0
    Location:
    Weddington, NC
    pretty much....not so much being impatient as not knowing for sure if it was actually doing anything or not. Ended up writing a little vbscript to do it so I could see progress.....it ran for about 10 hours

    [​IMG]
     
  10. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Nope. I run a disk-cleanup program that deletes every .TMP file on my hard drive, and it starts deleting the instant I hit Enter. There are spans of up to a minute where nothing shows up onscreen while it scans the file index, but it doesn't wait until it finds all the .TMP files before it starts deleting them.
     
  11. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Are you actually trying to say that the screen is lagging behind what actually is happening in the background?
     
  12. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    No, I'm saying when I use the DEL command to delete lots of files scattered across the hard drive, Windows will delete each file as soon as it finds it instead of waiting until it's found them all before deleting them. There's no screen lag -- though if it takes a long time to find the next file to be deleted, it will look like nothing's happening, except my hard drives are so loud that I know something is happening.
     

Share This Page