Simply using a PowerShell command you are able to empty Recycle Bin automatically when Shutting Down Windows 10 or 11. Regular evacuation of deleted files is greatly helpful to reduce the pressure from the hard disc on a device. By default setting, when deleting something on Windows 10 it moves to recycle bin only. They remain in the folder until and unless you clear it manually.
To get rid of unnecessary items residing in the recycle bin automatically Group Policy editor also helps. This method will allow removal of the files and folders without putting extra efforts time and again from your side. Sometimes, you may forget to delete them and thus keep stacking cause the lag of computer.
Ways to Empty Recycle Bin Automatically when Shutting Down Windows 11 and 10
Here is how to Recycle Bin Automatically when Shutting Down Windows 11 or 10 –
Step-1: First of all, you have to create a script that will use to empty the Recycle Bin. Open the notepad application and paste the following shell command into it –
PowerShell.exe -NoProfile -Command Clear-RecycleBin -Confirm:$false
Step-2: Click on File and select Save from the drop-down.
Step-3: Give a unique name and change the extension name of the script by .bat (default is .txt)
Step-4: You can check the above procedure by moving a few files in the Recycle Bin and then launching the script. If the available files get deleted, it means the entire procedure is working properly.
Now there’s the need to set up this script to Empty Recycle Bin Automatically when Shutting Down Windows 11 or 10.
- Press Win+R hotkey to launch the Run dialog box.
- Type the command ‘gpedit.msc’ and then press Enter to open Local Group Policy Editor.
- Subsequent to loading the Group Policy Editor, go through following path – Computer Configuration => Windows Settings => Scripts => Shutdown
- Click on Add => Browse button in the Shutdown screen.
- Now, navigate to the location of the script, select it and then click on Open. Moreover, there is no need to provide additional script parameters because they’re already defined in the command.
- Accordingly, Windows 11 or 10 will be able to run the script after restarting the device once.