Ever found yourself breaking into a sweat after accidentally deleting a file, only to have the Recycle Bin save it from the void? We know we have! And we thank our lucky stars we have the Recycle Bin. But at other times, emptying the Recycle Bin can be pretty annoying; sort of like having to take out your neighbor’s garbage!
Since items stored in the Recycle Bin still take up hard disk space, it is a good idea to empty the bin every now and again. Of course, with a script like this, emptying the Recycle Bin doesn’t have to feel like such a chore.
If you — or any of your clients — have multiple hard drives or partitions connected to a single computer, each location will have its own Recycle Bin. While that may seem like it just adds more work to your already overloaded work day, you can use this script to conveniently empty the Recycle Bin in a jiffy.
This script deletes all files in the Recycle Bin of the system drive (typically the C: drive) for all users.
del /s /q %systemdrive%\$Recycle.bin
How to empty the Recycle Bin of other users?
The Empty Recycle Bin script deletes all files in the Recycle Bin for all users. From the Atera app, go to Admin > Patch Management and IT Automation and open your profile or create a new one. Under Scripts, click Add script. Then type “Empty Recycle Bin” in the search bar. Clone the script to save it in your My Scripts tab. From here, you can select the script to add it to the automation profile, where it will run silently when scheduled.
If you have an audit or compliance requirement, we recommend scanning the contents of users’ Recycle Bins before running this script to make sure no important files are deleted.