Lagos, Nigeria
info@ezefidelity.com

Empty Recycle Bin Automatically before Shutting Down (Windows 10)

Empty Recycle Bin Automatically before Shutting Down (Windows 10) post thumbnail

Recycle bin is your Windows 10 computer trash can. When you delete anything in your computer, it goes to the recycle bin, it does not go out of your computer immediately.

As the name implies, the purpose of the Recycle Bin is to give you a means of restoring deleted files at a later time. However, if you are the very cautious type, that never does a mistake of deleting a file or document you will later need, then the Recycle Bin can be a real pain in the ass.

What I mean

Because the function of Recycle Bin is always present, it means, you always have to delete a file twice (first from the place the file is located, and second from the Recycle Bin), before you can be confident that it is no longer in your computer.

Also, if you have a habit of forgetting to empty your computer’s trash can (Recycle Bin), overtime, the files you thought you have deleted will be the ones consuming your computer’s drive storage, without you having a clue.

So, what is the solution?

In this post, I will show you how to create a script that will empty your Recycle Bin for you automatically, as you are shutting down your computer.

How to create the Recycle Bin Delete Script

Open Notepad, then copy and paste this line of command into it. PowerShell.exe -NoProfile -Command Clear-RecycleBin -Confirm:$false

Now press Ctrl + S to save it. It is important that when saving, you add .bat at the end of the name. Example, Recycle Bin Cleaner.bat
if you do not add the .bat extension to it, Windows 10 will not treat it as a script, and thus it will not empty your Recycle Bin for you automatically during shut down.

For those that do not know how to open Notepad, do the following.
Hit the Windows button Windows button keyboard icon on your keyboard. Locate and expand the Windows accessories folder in the app list. Then click on Notepad.

opening Notepad from start menu app list in windows 10

Alternatively, you can type in Notepad into the search box in the taskbar and click on Notepad from the app result.

opening Notepad from Windows 10 taskbar menu search

Making the Script Run Automatically

Now, we have created the script, it is now time to make it run automatically so that it will empty the Recycle Bin when your computer is shutting down. To do this, follow these steps.

Type in either gpedit.msc or Edit Group Policy into the taskbar search box, then click to open. Anyone you use, will open the same utility tool.

opening windows 10 group policy editor from taskbar search

In the left pane when the Group Policy Editor opens, click on Computer Configuration, then on Windows Settings, and then on Scripts.

Now, to the right pane, click on Shutdown and then on Properties.

setting up a shutdown script with Group Policy Editor in Windows 10 step 1

In the Shutdown Properties window, click the Add button, then on Browse to locate and select the Recycle Bin Cleaner.bat script we created earlier.

setting up a shutdown script with Group Policy Editor in Windows 10 step 2

After that, click the OK button to save the changes. And you are all set.
Henceforth, emptying the Recycle Bin will now part of the things Windows 10 will do for you automatically, before shutting down your computer.

Word of Caution ⚠

Enabling this feature is like saying, you are perfect, hence you do not delete files you will still need in the future.

In any case, if you delete a file, and you are having doubts about the files relevance in the future, it is better to restore it now, before you shutdown.

If you want to deactivate the automatic emptying of your Recycle Bin, just delete the script (Recycle Bin Cleaner.bat). if you do not want to delete the script, then head back to the Group Policy Editor tool, in the Shutdown Properties window, select the script, click on the Remove button below the Add, and then the OK button to save the changes.

Is there a Better Alternative?

If setting up this script looks too stressful for you, there is an alternative. But I am not sure if that is a better one.

The alternative is for you to use the Shift + Delete keys in your keyboard to delete the file.

When you use this shortcut key to delete a file, Windows 10 will bypass the Recycle Bin and delete the file permanently, and immediately after confirmation.

Hence, there is no hope of you recovering the file, whether you shutdown your computer or not, the file is gone and gone forever.



Do you find this article helpful? Your Friend might too. So, please Share it with them using the Share button above.
Will you like to get notified when I post new updates? Then Follow me on any of my social media handles: Google News, Telegram, WhatsApp, Twitter, Facebook, Pinterest.
You can also drop your email address below if you wish to be notified by mail.


Tags: ,

%d bloggers like this: