Sometimes users need to delete all files within selected folders in Windows 11.

For example, you might free up some drive space by erasing all junk files within the Temp folder.

To clear a folder without erasing it, youll usually need to pressCtrl+Ato select all files and then pressDelete.

A Windows 11 PC

However, there is a better way to empty a folder.

you’re free to create a new File Explorer context menu option for emptying folders instead.

This first registry script will add a context menu entry that erases all files within a primary folder.

The registry script for the Empty folder option

However, that option wont delete subfolders in the same directory.

To do so, press theWin+Eto view Explorers window.

Right-smack the Temp folder and selectShow more options.

The Save as menu option

pick the newEmpty foldercontext menu option.

A message will then appear requesting confirmation.

Press theYbutton to confirm and erase all junk files that arent in use within the Temp folder.

The All files option

TheEmpty folderoption permanently deletes all files.

So, you wont be able to restore them from the Recycle Bin.

So, well set up an additional context menu option that also deletes subfolders in a folder.

The Empty folder option

Then you’re able to use that option to fully empty a folder when needed.

However, youll need to copy a different script for step three.

Now youll see anEmpty folder and delete subdirectoriesoption on the classic context menu.

The confirmation message for emptying the folder

Select that option whenever you’re gonna wanna completely clear out a folder.

To do so, double-click theMUIVerbstring for theEmptyFolder2key.

That context menu option will have whatever title you enter for it there.

The EmptyFolder key’s Delete option

Empty Your Folders With Convenient Context Menu Options

AnEmpty folderoption is something File Explorer should already include.

Those new options will come in handy for clearing cache folders or other directories full of unneeded user files.

The registry script for the Empty folder and delete subfolders option

The Empty folder and delete subfolders context menu option

The MUIVerb string or the EmptyFolder2 key