How to Add an Option to Empty a Folder to the Context Menu in Windows 11

Sometimes users need to delete all files within selected folders in Windows 11. For example, you can free up some drive space by erasing all junk files within the Temp folder. To clear a folder without erasing it, you’ll usually need to pressCtrl+Ato select all files and then pressDelete.

However, there is a better way to empty a folder. You can create a new File Explorer context menu option for emptying folders instead. This is how you can set up two alternative context menu options for emptying folders in Windows 11.

4

How to Add an Empty Folder Contents Option to the Context Menu

You can create new context menu options for emptying folders with registry scripts. This first registry script will add a context menu entry that erases all files within a primary folder. However, that option won’t delete subfolders in the same directory. You can set up the registry script for adding thatEmpty folderoption as follows:

Now you’re able to try out the newEmpty foldercontext menu option. To do so, press theWin+Eto view Explorer’s window. Input this folder location in File Explorer’s path bar and pressEnter:

A Windows 11 PC

You’ll need to replaceuser folder namein that path with your actual user folder’s title.

There you’ll find the Temp folder, from which you can nowerase all temporary junk files on Windowswith your new context menu option. Right-click the Temp folder and selectShow more options. Select the newEmpty foldercontext menu option.

The registry script for the Empty folder option

A message will then appear requesting confirmation. Press theYbutton to confirm and erase all junk files that aren’t in use within the Temp folder. TheEmpty folderoption permanently deletes all files. So, you won’t be able to restore them from the Recycle Bin.

If you later decide you don’t want to keep theEmpty folderoption, it’s possible to remove it from the context menu. To do that, you’ll need to delete theEmpty folderoption’s registry key like this:

The Save as menu option

How to Add an “Empty Folder and Delete Subfolders” Option to the Context Menu

TheEmpty folderoption added with the registry script above doesn’t erase subfolders in directories. So, we’ll set up an additional context menu option that also deletes subfolders in a folder. Then you can use that option to fully empty a folder when needed.

You can set up a registry script for adding anEmpty folder and delete subfolderscontext menu option with Notepad much the same as specified above. However, you’ll need to copy a different script for step three. Copy and paste (seehow to copy and paste on Windows 11) the following script into Notepad:

The All files option

Follow all the other steps after that as outlined above. Input anEmpty Folder and Delete Subdirectories.regfile name for the registry script, and save it to the desktop. Then double-click that registry script on the desktop to add anEmpty folder and delete subdirectoriescontext menu option.

Select a folder in Explorer, and press theShift+F10hotkey. Now you’ll see anEmpty folder and delete subdirectoriesoption on the classic context menu. Select that option whenever you need to completely clear out a folder.

You can remove that context menu option much the same as theEmpty folderone. Open that option’s key location in the Registry Editor and delete it from there. This is theEmpty folder and delete subdirectoriesoption’s registry key location:

You can also change the wording of theEmpty folder and delete subdirectoriescontext menu option from that registry location. To do so, double-click theMUIVerbstring for theEmptyFolder2key. EraseEmpty folder and delete subdirectoriesin theValuebox; then input an alternative title for the option there and clickOKto change it. That context menu option will have whatever title you enter for it there.

Empty Your Folders With Convenient Context Menu Options

AnEmpty folderoption is something File Explorer should already include. Now you can easily clear out your folders in Windows 11 with two convenient Explorer context menu options. Those new options will come in handy for clearing cache folders or other directories full of unneeded user files.

Get more out of File Explorer with the Preview and Details pane, both of which will help you sort through your files on Windows.

My foolproof plan is to use Windows 10 until 2030, with the latest security updates.

Not Linux, not Windows. Something better.

Turn these settings on, and your iPhone will be so much better than before.

Your phone is a better editor than you give it credit for.

Don’t let someone else take over your phone number.

Technology Explained

PC & Mobile