/
/

How to Add Show Recycle Confirmation to Recycle Bin Context Menu in Windows 10

How to Add Show Recycle Confirmation to Recycle Bin Context Menu in Windows 10 blog banner image

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

  1. Press Win + R, type regedit, and hit Enter.
  2. If prompted by the User Account Control (UAC), click Yes.
  3. Using the Registry Editor’s address bar, navigate to the following directory:

HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell

  1. On the left-hand pane, right-click on the shell key and select New > Key.
  2. Name it ShowRecycleConfirm and press Enter.
  3. Name the context menu option.
    1. Right-click on a space in the right pane and select New > String Value.
    2. Name it (Default) and press Enter.
    3. Double-click on (Default) to modify its value.
    4. In the Value field, type Toggle Recycle Confirmation.
    5. Click OK.
  4. Assign an icon (optional).
    1. Right-click on a space in the right pane and select New > String Value.
    2. Name it Icon and press Enter.
    3. Double-click on Icon to modify its value.
    4. In the Value field, type imageres.dll,-5302.
    5. Click OK.
  5. Decide where it’s placed on the context menu.
    1. Right-click on a space in the right pane and select New > String Value.
    2. Name it Position and press Enter.
    3. Double-click on Position to modify its value.
    4. In the Value field, type Top.
    5. Click OK.
  6. Right-click on ShowRecycleConfirm and select New > Key.
  7. Name it command and press Enter.
  8. Double-click on command to modify its value.
  9. 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 }"

  1. Click Apply, then OK.
  2. 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).

  1. Press Win + S, type Notepad, and hit Enter.
  2. 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 }\""

  1. Press Ctrl + S and name the file Add_ToggleRecycleConfirm.reg.
  2. Choose the All files file type and hit Enter.
  3. Open the file to apply the Registry settings. Alternatively, run the script through automation tools to deploy the .reg file across multiple workstations.
  4. When prompted by the UAC, click Yes.
  5. 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:

  1. Press Win + R, type regedit, and hit Enter.
  2. If prompted by the User Account Control (UAC), click Yes.
  3. Using the Registry Editor’s address bar, navigate to the following directory:

HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell

  1. In the right-hand pane, right-click the ShowRecycleConfirm key and select Delete.
  2. Click Apply, then OK.
  3. 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

  1. Press Win + R, type regedit, and hit Enter.
  2. If prompted by the User Account Control (UAC), click Yes.
  3. Using the Registry Editor’s address bar, navigate to the following directory:

HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\ShowRecycleConfirm

  1. Ensure that each string’s values are set properly.
  2. Click Apply, then OK.

Restart Windows Explorer to apply changes

  1. Run an elevated Command Prompt.
  2. 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. 

  1. Press Win + S, type cmd, and select Command Prompt (Run as administrator).
  2. Type gpedit.msc, and hit Enter.
  3. If prompted by the User Account Control (UAC), click Yes.
  4. Using the left-hand pane, navigate to Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell.
  5. 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.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).