Empty Recycle Bin for all users on server/PC

Probably you had situation where you need to free up some space from disk because it is full. Usually when it comes to shared computers, whether they are personal PCs or servers, people forgot to empty RecycleBin and you end up with full disk drive. It sometimes takes even tens of gigabytes of disk space. To correct situation I will give just this one-liner. Open PowerShell and just replace drive letter with correct one

gci -Path "s:\`$Recycle.bin" -Force -File -Recurse | Remove-Item -Force

That all you need. Enjoy the weekend

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.