You can effectively empty the recycle bin from the command line by permanently deleting the recycle bin directory on the disk that contains system files. (In most cases, this will be the C: drive, but you should not specify this value because it will not always be true. Use the %systemdrive% environment variable %systemdrive% .)
The reason this tactic works is because each drive has a hidden protected folder called $Recycle.bin , where the $Recycle.bin bin actually stores deleted files and folders. When this directory is deleted, Windows will automatically create a new directory.
So, to delete a directory, use the rd (r emove d-directory) command with the /s option, which indicates that all files and directories in the specified directory should also be deleted:
rd /s %systemdrive%\$Recycle.bin
Please note that this action will permanently delete all files and folders in the recycle bin from all user accounts . In addition, you (obviously) will have to execute the command from an elevated command prompt in order to have sufficient privileges to perform this action.
Cody Gray Feb 11 '12 at 9:30 2012-02-11 09:30
source share