Do you want to clean Recycle Bin automatically while signing out on Windows 11/10? In this gearupwindows article, we will guide you to do so.
If you frequently delete the files or folders and forget to empty the Recycle Bin, it may occupy a lot of space on your PC. Recycle Bin works like a safety net, and every time you delete any file or folder from your PC, Recycle bin stores it so that you can restore those files whenever you want. That means, after deleting a file/folder also, until you have emptied the Recycle Bin, you can recover them.
But, when you delete many files and want to keep the recycle bin clean without any intervention, you can configure your Windows 11/10 to empty the recycle bin when signing out from your PC. That means, when you restart or sign in again on your PC, all the files and folders from the recycle bin will be deleted automatically. You don’t need to empty the recycle Bin manually.
Microsoft had introduced the Storage sense feature on Windows 10 and is also available on Windows 11 to automatically empty the recycle bin. But, this storage sense feature does not allow you to clean your Recycle Bin folder automatically after signing out from your Windows. Let us take one more example. Suppose you maintain a cyber cafe where you want to keep your PC clean by emptying the recycle bin when a user leaves your PC. You can manually empty the recycle bin if you wish to or leave a script to clean the recycle bin automatically. If you forget to empty the recycle bin, still your PC will empty the recycle bin when you log off your PC.
To empty the recycle bin automatically, we will not go through lengthy steps, which means we will use a simple script, that will automatically run and clean your recycle bin.
How to Empty Recycle Bin Automatically while Signing out from Windows 11/10?
Step 1. Press
Step 2. Type
Step 3. In the Notepad window that opens, copy and paste the following texts:-
PowerShell.exe -NoProfile -Command Clear-RecycleBin -Confirm:$false
Step 4. Click on the
Step 5. In the Save as dialog, select the file’s location where you want to save this batch file. Next, Type the file name as “Empty Recycle Bin.bat.” Now, choose the
Once you complete the above steps, you will see a file Empty Recycle Bin.bat in the specified location. By double-clicking on this batch file, you can empty the recycle bin, but our purpose is not solved. So, you need to do some steps.
Step 6. Open the Group Policy Editor.
Step 7. From the left sidebar, navigate to the following path:-
Computer Configuration > Windows Settings > Scripts (Startup/Shutdown)
Step 8. On the right side pane of the Scripts (Startup/Shutdown), double-click on the
Step 9. Click on the
Step 10. In the pop-up window, click on the
Step 11. Click
Step 12. Click
That’s it. Now, this script will automatically run whenever you shut down your PC. That means your recycle bin will automatically be emptied when you shut down your PC.