0

I have a folder on my Windows 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.

Giacomo1968
  • 58,727

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.

Giacomo1968
  • 58,727
LPChip
  • 66,193