0

I have a folder on my Server, it's 90GB big, and it has Millions of Files, and i want to delete it, but del /s /q took 3 days just to delete the first 1GB Folder, so my Idea would be, just writing 0's over the area where the files are, because deleting every file in a loop will probably take 270 Days at this rate.

ishc3ice
  • 1
  • 1
  • 1
  • Did you try rmdir? –  Apr 19 '20 at 16:17
  • 4
    Does this answer your question? Mass deleting files in Windows – Daniel B Apr 19 '20 at 16:29
  • 1
    the fastest way that I know is command line. rd /s /q "folder". be careful.. this is a powerful command. Make sure your command prompt doesn't have admin access. The windows GUI has become simply stupid when trying to do something like this. It takes more time to calculate what it is going to do than simply do it. – Señor CMasMas Apr 19 '20 at 17:16
  • hey! thanks for asking that question. my DOS days are far, far in the past. and i'm just testing to shake old data off a volume. over 30TB to wipe to keep 25TB or so. no, you should never create that big volumes. good that you did better than the people here. – Florian Heigl Sep 01 '23 at 01:37

1 Answers1

0

Before you remove files, make sure you are on the host side. If you are deleting files over a network share, things will be slow. So remote into your server before deleting the files, and make sure you use the local drive to delete the files, not a network share pointing to the local drive.

Now, the next problem is making sure you are not going file-by-file, which is what the del command does.

Instead, you will want to use the rd (or rmdir) command. Normally an rd <folder> will throw in an error stating that the folder is not empty and will not delete it, but this is just a safeguard.

rd has an option to delete files too, namely /s.

So what you want to do is executing a rd /s <folder> and it will delete that folder with everything inside it in a matter of seconds.

LPChip
  • 61,264