• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Deleting 400,000 files

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Deleting 400,000 files

    Well it's at least 400,000 because that's where I got bored with watching the folder properties count up. So who knows? It may be millions.

    This is on a Windows 2003 server. The SMTP server has a badmail folder, which I'm guessing is where a couple of years worth of spam has been accumulating. This is what I'm trying to clear out.

    If I try to select the folder with Explorer, then it just dies. If I right click and choose delete, it says "preparing to delete" until I get bored and cancelled it. And I'm currently running delete *.* in a command prompt, but that's having a good long think too and doesn't seem to be doing anything.

    Is there any sensible way I can delete a folder and not worry about the contents?

    This is a remote server I can only access via remote desktop. Part of the problem is if I just leave it doing something, the RDP session times out and kills the processes.
    Will work inside IR35. Or for food.

    #2
    Give...

    Code:
    rmdir /s /q <folder>
    ...a go. It's still going to be slow but quicker than del *.* apparently.
    Where are we going? And what’s with this hand basket?

    Comment


      #3
      if it's on its own drive/partition then you could reformat it
      Coffee's for closers

      Comment


        #4
        This will allow you see what is happening (instead of looking like it is doing nothing)

        del /F /S /Q <Folder>

        Also, this should stop it from happening again
        http://www.microsoft.com/downloads/d...displaylang=en

        Edit: oh yeah, to the Remote issue, it on the same network? If so map to the folder from local machine and run command, bit slower in the delete but should have no time out issues
        Last edited by Not So Wise; 8 December 2009, 10:38.

        Comment


          #5
          Can you try

          DEL A*.*
          DEL B *.*

          and do it in small chunks

          Comment


            #6
            Originally posted by voodooflux View Post
            Give...

            Code:
            rmdir /s /q <folder>
            ...a go. It's still going to be slow but quicker than del *.* apparently.
            Ta. Had that running for half an hour now.

            I guess del *.* probably builds a list of files to delete, then deletes one at a time which must in itself be really innefficient with a directory full of files.
            Will work inside IR35. Or for food.

            Comment


              #7
              Originally posted by zeitghost
              For %1 in (*.*) do del %1

              Does it one at a time.
              Yes, but "*.*" still has to be evaluated

              Comment


                #8
                It took nearly 4 hours, but it's gone!

                I'll try out that cleanup program. Thanks all.
                Will work inside IR35. Or for food.

                Comment


                  #9
                  What you need to do first is disable the Recycle Bin and then it will go like the clappers.
                  Originally posted by VectraMan View Post
                  It took nearly 4 hours, but it's gone!
                  Oh, never mind.
                  My all-time favourite Dilbert cartoon, this is: BTW, a Dumpster is a brand of skip, I think.

                  Comment


                    #10
                    Windows (NTFS) is not good when dealing with a lot of small files, it can be faster to reformat the whole disk or copy it using per sector copying.

                    SKA had to change algorithm on how it stores small files sometime in 2006.

                    Comment

                    Working...
                    X