General Add Empty Folder context menu in Windows 11


Folder_delete2_banner.png

This tutorial will show you how to add or remove the Empty folder context menu for folders for all users in Windows 10 and Windows 11.

You can add a Empty folder context menu to permanently delete the file contents of a folder after a one time Y/N confirmation to prevent emptying the folder by mistake.

Subfolders and their contents will not be deleted. Only the file contents in a folder you right clicked on will get permanently deleted.


While you must be signed in as an administrator to add or remove the context menu, all users can use the context menu.



EXAMPLE: Empty folder context menu

In Windows 11, you will need to click/tap on Show more options first by default, then click/tap on Empty folder.



Show_more_options.png
Empty_folder_context_menu.png

Empty_folder_confirm_prompt.png



Here's How:

1 Do step 2 (add) or step 3 (remove) below for what you would like to do.

2 Add "Empty folder" Context Menu

A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Add_Empty_folder_context_menu.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\EmptyFolder]
"Icon"="shell32.dll,-16715"
"MUIVerb"="Empty folder"
"Position"="bottom"

[HKEY_CLASSES_ROOT\Directory\shell\EmptyFolder\command]
@="cmd /c title Empty \"%1\" & (cmd /c echo. & echo This will permanently delete all contents in only this folder and not subfolders. & echo. & choice /c:yn /m \"Are you sure?\") & (if errorlevel 2 exit) & (cmd /c \"cd /d %1 && del /f /q *.*\")"

3 Remove "Empty folder" Context Menu

This is the default setting.


A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Remove_Empty_folder_context_menu.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\EmptyFolder]

4 Save the .reg file to your desktop.

5 Double click/tap on the downloaded .reg file to merge it.

6 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

7 You can now delete the downloaded .reg file if you like.


That's it,
Shawn Brink


 

Attachments

Last edited:
This is no longer working after I updated to 24H2. It shows on my context menu but is no longer emptying any of folders I used to use it on. :(
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft 15" Surface Laptop 4
    CPU
    AMD Ryzen 7
    Memory
    8GB
    Graphics Card(s)
    AMD Radeon
    Hard Drives
    512GB WD SSD
    Internet Speed
    384 Mbps per attached network device
    Browser
    MS Edge
    Antivirus
    Windows Defender
  • Operating System
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell XPS 8950
    CPU
    12th Gen Intel(R) Core(TM) i9-12900K, 3200 Mhz, 16 Core(s), 24 Logical Processor(s)
    Memory
    32 GB DDR5
    Graphics card(s)
    NVIDIA GeForce GTX 1660 Ti
    Monitor(s) Displays
    32" Samsung
    Mouse
    Logitech MX Master 3 (BT)
    Keyboard
    Arteck (BT)
    Internet Speed
    990 Mbps
    Browser
    MS Edge/Floorp
    Antivirus
    Windows Defender/Malwarebytes
This is no longer working after I updated to 24H2. It shows on my context menu but is no longer emptying any of folders I used to use it on. :(

Hello mate, :alien:

I just tested on my system to see if anything may have changed, but the context menu still works for me.

Does it not work on any folder, or a specific folder?

Do you see the Y/N command prompt after using the context menu to approve emptying the folder?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender
I copied the entry from my 23H2's registry and it is back working.

So, the working reg file should be this version:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\EmptyFolder]
"Icon"="shell32.dll,-16715"
"MUIVerb"="Empty Folder"
"Position"="bottom"
"NeverDefault"=""

[HKEY_CLASSES_ROOT\Directory\shell\EmptyFolder\command]
@="cmd.exe /c (choice /c:yn /m \"Are you sure you want to delete everything in the folder '%1'?\") & (if errorlevel 2 exit) & (cmd /c rd /s /q \"%1\" & md \"%1\")"

[HKEY_CLASSES_ROOT\Directory\Background\shell\EmptyFolder]
"Icon"="shell32.dll,-16715"
"MUIVerb"="Empty Folder"
"Position"="bottom"
"NeverDefault"=""


[HKEY_CLASSES_ROOT\Directory\Background\shell\EmptyFolder\command]
@="cmd.exe /c (choice /c:yn /m \"Are you sure you want to delete everything in the folder '%V'?\") & (if errorlevel 2 exit) & (cmd /c rd /s /q \"%V\" & md \"%V\")"
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft 15" Surface Laptop 4
    CPU
    AMD Ryzen 7
    Memory
    8GB
    Graphics Card(s)
    AMD Radeon
    Hard Drives
    512GB WD SSD
    Internet Speed
    384 Mbps per attached network device
    Browser
    MS Edge
    Antivirus
    Windows Defender
  • Operating System
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell XPS 8950
    CPU
    12th Gen Intel(R) Core(TM) i9-12900K, 3200 Mhz, 16 Core(s), 24 Logical Processor(s)
    Memory
    32 GB DDR5
    Graphics card(s)
    NVIDIA GeForce GTX 1660 Ti
    Monitor(s) Displays
    32" Samsung
    Mouse
    Logitech MX Master 3 (BT)
    Keyboard
    Arteck (BT)
    Internet Speed
    990 Mbps
    Browser
    MS Edge/Floorp
    Antivirus
    Windows Defender/Malwarebytes
The old download reg file reads:

Windows Registry Editor Version 5.00

; Created by: Shawn Brink
; Created on: September 24, 2022
; Tutorial: Add Empty Folder context menu in Windows 11


[HKEY_CLASSES_ROOT\Directory\shell\EmptyFolder]
"Icon"="shell32.dll,-16715"
"MUIVerb"="Empty folder"
"Position"="bottom"

[HKEY_CLASSES_ROOT\Directory\shell\EmptyFolder\command]
@="cmd /c title Empty \"%1\" & (cmd /c echo. & echo This will permanently delete all contents in only this folder and not subfolders. & echo. & choice /c:yn /m \"Are you sure?\") & (if errorlevel 2 exit) & (cmd /c \"cd /d %1 && del /f /q *.*\")"
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft 15" Surface Laptop 4
    CPU
    AMD Ryzen 7
    Memory
    8GB
    Graphics Card(s)
    AMD Radeon
    Hard Drives
    512GB WD SSD
    Internet Speed
    384 Mbps per attached network device
    Browser
    MS Edge
    Antivirus
    Windows Defender
  • Operating System
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell XPS 8950
    CPU
    12th Gen Intel(R) Core(TM) i9-12900K, 3200 Mhz, 16 Core(s), 24 Logical Processor(s)
    Memory
    32 GB DDR5
    Graphics card(s)
    NVIDIA GeForce GTX 1660 Ti
    Monitor(s) Displays
    32" Samsung
    Mouse
    Logitech MX Master 3 (BT)
    Keyboard
    Arteck (BT)
    Internet Speed
    990 Mbps
    Browser
    MS Edge/Floorp
    Antivirus
    Windows Defender/Malwarebytes
It'll be interesting to hear from others what they are experiencing since the current one in the tutorial still works for me in 24H2.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender
Not sure what changed on mine. I upgraded to 24H2 a couple days ago. At least if the one file doesn't work (wouldn't work on any folder suddenly), it looks like the second posted one will likely get it to working again. 👍
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft 15" Surface Laptop 4
    CPU
    AMD Ryzen 7
    Memory
    8GB
    Graphics Card(s)
    AMD Radeon
    Hard Drives
    512GB WD SSD
    Internet Speed
    384 Mbps per attached network device
    Browser
    MS Edge
    Antivirus
    Windows Defender
  • Operating System
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell XPS 8950
    CPU
    12th Gen Intel(R) Core(TM) i9-12900K, 3200 Mhz, 16 Core(s), 24 Logical Processor(s)
    Memory
    32 GB DDR5
    Graphics card(s)
    NVIDIA GeForce GTX 1660 Ti
    Monitor(s) Displays
    32" Samsung
    Mouse
    Logitech MX Master 3 (BT)
    Keyboard
    Arteck (BT)
    Internet Speed
    990 Mbps
    Browser
    MS Edge/Floorp
    Antivirus
    Windows Defender/Malwarebytes

Latest Tutorials

Back
Top Bottom