The “Show recycle confirmation” context menu option allows users to enable/disable confirmation pop-ups when deleting files or folders. By default, the dialog box is displayed to help prevent accidental file removal, but having a custom switch can improve automation and even streamline employee workflows.
This article explains the “Show recycle confirmation” option, how to add it to your recycle bin context menu, and important troubleshooting tips.
Step-by-step guide to adding the context menu item
⚠️ These methods involve modifying your Registry and require admin privileges. Before you start, prepare a backup.
Method 1: Add “Show recycle confirmation” context menu via Registry Editor
- Press Win + R, type
regedit
, and hit Enter. - If prompted by the User Account Control (UAC), click Yes.
- Using the Registry Editor’s address bar, navigate to the following directory:
HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell
- On the left-hand pane, right-click on the shell key and select New > Key.
- Name it ShowRecycleConfirm and press Enter.
- Name the context menu option.
- Right-click on a space in the right pane and select New > String Value.
- Name it (Default) and press Enter.
- Double-click on (Default) to modify its value.
- In the Value field, type Toggle Recycle Confirmation.
- Click OK.
- Assign an icon (optional).
- Right-click on a space in the right pane and select New > String Value.
- Name it Icon and press Enter.
- Double-click on Icon to modify its value.
- In the Value field, type
imageres.dll,-5302
. - Click OK.
- Decide where it’s placed on the context menu.
- Right-click on a space in the right pane and select New > String Value.
- Name it Position and press Enter.
- Double-click on Position to modify its value.
- In the Value field, type Top.
- Click OK.
- Right-click on ShowRecycleConfirm and select New > Key.
- Name it command and press Enter.
- Double-click on command to modify its value.
- In the Value field, paste the following PowerShell command:
powershell.exe -WindowStyle Hidden -Command "& { $reg='HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'; if ((Get-ItemProperty -Path $reg -Name ConfirmFileDelete -ErrorAction SilentlyContinue).ConfirmFileDelete -eq 1) { Set-ItemProperty -Path $reg -Name ConfirmFileDelete -Value 0 } else { Set-ItemProperty -Path $reg -Name ConfirmFileDelete -Value 1 }; Stop-Process -Name explorer -Force }"
- Click Apply, then OK.
- Close Registry Editor and restart the PC to apply changes.
Method 2: Add “Show recycle confirmation” context menu option via the .reg file
These steps outline how to add a context menu option that toggles the recycle confirmation dialog via .reg files. This method is especially useful when you want to implement a custom option system-wide using batch files and Group Policy Objects (GPO).
- Press Win + S, type Notepad, and hit Enter.
- Paste the following PowerShell command:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\ShowRecycleConfirm]
@="Toggle Recycle Confirmation"
"Icon"="imageres.dll,-5302"
"Position"="Top"
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\ShowRecycleConfirm\command]
@="powershell.exe -WindowStyle Hidden -Command \"& { $reg='HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer'; if ((Get-ItemProperty -Path $reg -Name ConfirmFileDelete -ErrorAction SilentlyContinue).ConfirmFileDelete -eq 1) { Set-ItemProperty -Path $reg -Name ConfirmFileDelete -Value 0 } else { Set-ItemProperty -Path $reg -Name ConfirmFileDelete -Value 1 }; Stop-Process -Name explorer -Force }\""
- Press Ctrl + S and name the file Add_ToggleRecycleConfirm.reg.
- Choose the All files file type and hit Enter.
- Open the file to apply the Registry settings. Alternatively, run the script through automation tools to deploy the .reg file across multiple workstations.
- When prompted by the UAC, click Yes.
- Restart the PC to apply changes.
How it works
The “Show recycle confirmation” context menu option uses the Registry to toggle the confirmation prompt by modifying its DWORD value. The specific key used (“ConfirmFileDelete”) is located in the directory below:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
ConfirmFileDelete is typically “on” by default, but changing its value to “0” removes the confirmation prompt that asks if you’re sure about deleting a file or folder. The PowerShell commands above manipulate this value when “Show recycle confirmation” is selected.
🛑| Manage and secure file permissions with on-demand menu options.
Read NinjaOne’s guide on how to add reset permissions to the context menu.
Removing the context menu entry
⚠️ This method involves modifying your Registry and requires admin privileges. Before you start, perform a backup.
If you want to declutter your Recycle Bin’s context menu, remove the “Show recycle confirmation” context menu option by doing the following:
- Press Win + R, type regedit, and hit Enter.
- If prompted by the User Account Control (UAC), click Yes.
- Using the Registry Editor’s address bar, navigate to the following directory:
HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell
- In the right-hand pane, right-click the ShowRecycleConfirm key and select Delete.
- Click Apply, then OK.
- Restart the PC to apply changes.
Troubleshooting common issues
Here are the most common roadblocks power users encounter when configuring the recycle bin context menu.
Issue: Context menu item not showing
If the “Show recycle confirmation” context menu item won’t appear, sign in as an administrator and try the following fixes:
Verify Registry path
- Press Win + R, type regedit, and hit Enter.
- If prompted by the User Account Control (UAC), click Yes.
- Using the Registry Editor’s address bar, navigate to the following directory:
HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\ShowRecycleConfirm
- Ensure that each string’s values are set properly.
- Click Apply, then OK.
Restart Windows Explorer to apply changes
- Run an elevated Command Prompt.
- Paste the following command line and hit Enter:
taskkill /f /im explorer.exe && start explorer.exe
Issue: Changes not applying
Ensure that the PowerShell command is valid and executable. Re-check all of the values to see if any policies are preventing code from being executed on the workstation.
Run the following code to temporarily disable execution restrictions and try again:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
Don’t forget to reset it to default settings once your task is complete.
Set-ExecutionPolicy Restricted -Scope CurrentUser
Issue: PowerShell blocked
If PowerShell scripts are blocked from being executed, try the code above to momentarily turn off restrictions or check your antivirus/security software settings for anything that hinders PowerShell. Lastly, look for Group Policy settings that could be blocking PowerShell scripts. Here’s how:
⚠️ This method requires admin privileges.
- Press Win + S, type cmd, and select Command Prompt (Run as administrator).
- Type
gpedit.msc
, and hit Enter. - If prompted by the User Account Control (UAC), click Yes.
- Using the left-hand pane, navigate to Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell.
- Disable any policy settings that are blocking PowerShell scripts and try again.
Simplify file disposal with the “Show recycle confirmation” context menu
Intuitive controls like “Show recycle confirmation” unlock more granular control for IT support staff. This toggle switch is particularly handy for power users, as they need to frequently fine-tune system preferences. Removing unnecessary pop-ups optimizes the workflow, making these custom, on-demand options a must.