Recycle bin on a PC stores its deleted files and documents,upon deletion a file is temporary stored in its recycle bin from where users can restore it,recycle bin proves very useful in case of accidental deletion of files, Today we are going to share a trick using which ,users can set up their PC to auto empty the contents of its recycle bin upon shut down.
This simple trick will prove to be very useful and efficient as well as time saving for the users ,instead of manually emptying the recycle bin ,you can set it to auto empty itself upon PC shut-down ,In order to perform this ,you need to create a script,that will empty the contents of recycle bin and next automate this script,to auto run itself with every shutdown,lets have a look at steps involved in order to accomplish this task.
1. Creating the script:-
- Initially Right-Click on you PC and Select the option New > Text document,
- Paste the following code in the document –
PowerShell.exe -NoProfile -Command Clear-RecycleBin -Confirm:$false
- Save this file as anyname.bat.
This file is well programed to delete the files of your Recycle bin ,upon opening it. The next step you need to perform is to automate this script,to run up every time you shut down your PC,follow the steps below in order to automate this script.
2. Automating the script:-
- Initially press Ctrl+r ,and type gpedit.msc ,followed by the enter key,you can also search for Group policy editor in your PC,
- In the group policy editor,head over to the following location , Computer configuration > Windows settings > Scripts > Shutdown
- In the Properties Windows of Shut-down,Click Add,
- Add the previously created anyname.bat file and save the changes.
Note:The Group Policy Editor is only available on Professional or Ultimate versions of Windows. Now whenever you shut down your PC ,the files in Recycle bin will get auto deleted ,just make sure you restore all you important files before shutting down the PC and also alternatively you can just learn this trick for informative purpose, if you do not wish to apply it or use it.