Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to delete a large directory on one of our Windows 2003 servers containing around 1TB of data. Would the quickest way to delete this be to use cmd > rmdir?

share|improve this question
See also the following questions on StackOverflow and SuperUser: What's the fastest way to delete a large folder in Windows?, Mass deleting files in Windows. – Heinzi Jan 17 '12 at 12:28
up vote 9 down vote accepted

Really, the fastest way I've discovered to do it has been, "rmdir /s [directory]". It seems to involve a LOT less meta-data operations than a, "del ." does, which makes it very zippy. I use it regularly to remove home directories with many thousands of files. Absolutely way faster than a remove-directory from Explorer, which seems to feel the need to count all the files before removing.

I haven't gone up to 1TB yet. If that 1TB involves less than, say, 10K files the big metadata operations would be marking vast swaths of space as free in the MFT. If that 1TB involves millions of files, then the metadata operations start to really slow things down on a file-by-file level. In that case, rmdir /s beats the pants off of Explorer.

share|improve this answer
Cool! Learn something new every day! Thanks! – JFV May 19 '09 at 16:31
still brought our server to its knees, when deleting a folder with 24k files using rmdir /q /s {folder} .. – Jeff Atwood Aug 4 '09 at 5:35

As sysadmin said, deleting individual files has massive overhead, so delete the folder. Regardless of the delete method you use, if you're going to delete a large number of files and/or folders it's worth temporarily disabling the AV software first. As a delete operation is both a read and a write the AV software is going to kick in and really slow things down, assuming of course you are running a real-time scanner.

share|improve this answer

I guess

rd /S /Q FolderToDelete

is the fastest option you have.

Warning: /S deletes all files and folders (tree) and /Q is the switch for "don't ask for confirmation."

share|improve this answer

Can I ask what you are trying to achieve ?

Unless you need the space back as quickly as possible then maybe the right method is to move the directory to a different location and spawn a thread that deletes files and directories slowly. This way the directory is not in the way and the server is not brought to its knees.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.