0

I have a Windows Server 2019 with 16GB Ram and 400GB HD space. One of the apps saves images uploaded by users which used up all of our HD space. Among other things I found 2 directories with 1 million and 1.2 million text files so I deleted these as the first action to free up some space. All of these went into the recycle bin (at the time I didn't know I could do a shift+del to delete them directly bypassing the recycle bin. Now we we have about 30GB free space on the hard-drive, but cannot empty the recycle bin.

If I open recycle bin, it just hangs while calculating the number of files and space. As it does this its slowly eating up memory until it uses all memory and the server crashes. If I right click on the recycle bin and select empty, nothing appears to happen, but if I look at task manager I can see that Windows Explorer is slowly eating up memory until the system crashes again. So even though I don't open the GUI, the recycle bin is still calculating things which eats up memory until it crashes.

I tried doing this with PowerShell running the command Clear-RecycleBin using the force parameter, it appears to hang in the command window and I can see in task manager that its processing and once again, eating up memory until the system crashes.

I'm really stuck here. How can I empty the recycle bin with out making it to first count the files and estimate the size of data it will remove?

Thanks.

spacedog
  • 446
  • 3
  • 13
  • Does this answer your question? [how to empty recyclebin through command prompt?](https://stackoverflow.com/questions/9238953/how-to-empty-recyclebin-through-command-prompt) – typewriter Feb 07 '22 at 19:26
  • You may possibly want to try ```del /q /s %systemdrive%\$Recycle.bin\*``` or ```for /d %%x in (%systemdrive%\$Recycle.bin\*) do @rd /s /q "%%x"```. – typewriter Feb 07 '22 at 19:29
  • This does not work. Even for this, windows does an inventory of the items to delete and in doing so it runs out of memory and crashes the server – spacedog Mar 06 '22 at 16:39
  • Honestly, I am out of my depth here. https://superuser.com/questions/1038602/cant-clear-recycle-bin-too-many-files user @ramhound suggests changing the max size of the bin. Would that work? I can not claim to know the answer. Definitely post an answer if you find a method that works. – typewriter Mar 07 '22 at 17:34
  • Thank you. We're going to setup a new server and migrate over as this one seems corrupt, and since its a production server we cannot experiment with solutions. – spacedog Mar 07 '22 at 22:03

0 Answers0