Key Points
- Add Windows Security via Registry Entries: Create shell keys under HKCR to add a Windows Security shortcut to the desktop context menu.
- Enable On-Demand Scans from Explorer: Add “Scan with Windows Security” to the file context menu by configuring the proper registry path and Defender scan commands.
- Deploy and Enforce at Scale: Use .reg files and PowerShell scripts through RMM/MDM tools to apply or remove Windows Security shortcuts consistently across endpoints.
- Validate Launch and Scan Behavior: Test added entries to confirm Windows Security opens correctly, and Defender completes scans without errors.
- Document Registry Paths and Deployment Steps: Record key locations, script usage, and verification procedures to prevent drift and support audits.
Windows Security handles all aspects of protection. It centralizes antivirus, firewall, and device protection controls. However, accessing it via the Start menu or taskbar slows workflows down. An option is to have critical tools in the right-click desktop context menu to speed things up, streamlining daily checks during troubleshooting.
This guide shows how to add Windows Security to the context menu in Windows 11, remove it when needed, and verify that the right-click entry opens the correct dashboard. It covers registry edits, optional scripted deployment, and validation steps suitable for standalone devices and managed environments.
Ways to add Windows Security to the context menu in Windows 11
Adding Windows Security to the right-click context menu requires the following:
📌 Prerequisites:
- You will need a Windows 11 device with administrative privileges.
- This needs permission to edit HKCR and HKLM registry paths.
- You will need to have Windows Security (Windows Defender) enabled on the system.
- This requires the optional use of PowerShell or .reg files if you plan to script deployment.
📌 Recommended deployment strategies:
Click to Choose a Method | 💻 Best for Individual Users | 💻💻💻 Best for Enterprises |
| Method 1: Via custom registry entry | ✓ | ✓ |
| Method 2: Remove Windows Security context menu | ✓ | ✓ |
| Method 3: Deploy via script or RMM | x | ✓ |
| Method 4: Validate Windows Security launch behavior | ✓ | ✓ |
Method 1: Adding Windows Security to the desktop context menu via a custom registry entry
📌 Use Cases:
- This provides fast access to Windows Security for administrators during incident response or malware investigations.
- Enables a consistent shortcut across devices without relying on the Start menu or taskbar placement
📌 Prerequisites:
- You will need administrative rights to make or modify registry keys under HKCR.
- This requires Windows Security to be active and not disabled by policy.
Steps:
- Open Registry Editor via the search button on the task bar, or by pressing Win + R, typing regedit, and pressing Enter.
- Next, navigate to: HKEY_CLASSES_ROOT\DesktopBackground\Shell.
- Right-click Shell, select New > Key, and name it WindowsSecurity.
- Select WindowsSecurity, double-click (Default), and set value to Windows Security.
- In the same key, create a String Value named Icon. Then, set its value to SecurityHealthSystray.exe.
- Right-click WindowsSecurity, select New > Key, and name it command.
- After this, select command, double-click (Default), and set the value to cmd.exe /c start “” “windowsdefender://”.
- Close the Registry Editor.
Method 2: How to remove Windows Security context menu entries
📌 Use Cases:
- This removes Windows Security shortcuts that were added manually or via deployment scripts.
- Restores the default context menu layout when entries are no longer needed or cause user confusion.
📌 Prerequisites:
- You will need administrative access to modify registry keys under HKEY_CLASSES_ROOT.
- This requires identifying which entries were added so you can safely remove only the intended keys.
Steps:
- Open Registry Editor.
- Navigate to this key: HKEY_CLASSES_ROOT\DesktopBackground\Shell.
- Locate and delete the WindowsSecurity key.
- Close the Registry Editor.
Method 3: Deploy context menu entries through script or RMM
📌 Use Cases:
- This allows MSPs and IT teams to apply or remove Windows Security context menu entries consistently across many devices.
- Supports automated onboarding workflows where registry entries must be enforced during provisioning.
📌 Prerequisites:
- You will need properly tested .reg files for adding or removing context menu entries.
- This requires an RMM, Intune, or similar management tool capable of running user-context scripts.
Steps:
- Open PowerShell and deploy this script:
$baseKey = "Registry::HKEY_CLASSES_ROOT\DesktopBackground\Shell\WindowsSecurity"
$cmdKey = "$baseKey\command"
New-Item -Path $baseKey -Force | Out-Null
New-Item -Path $cmdKey -Force | Out-Null
Set-ItemProperty -Path $baseKey -Name "(Default)" -Value "Windows Security"
Set-ItemProperty -Path $baseKey -Name "Icon" -Value "SecurityHealthSystray.exe"
Set-ItemProperty -Path $cmdKey -Name "(Default)" -Value 'cmd.exe /c start "" "windowsdefender://"'
- Push the script to target devices using your RMM, Intune, or another endpoint management platform.
- Next, add a verification step to confirm the registry path exists via PowerShell:
Test-Path "HKCR:\DesktopBackground\Shell\WindowsSecurity"
- Document the registry path, script location, and deployment procedure.
Method 4: How to validate Windows Security launch behavior
📌 Use Cases:
- This confirms that added or deployed context menu entries correctly open Windows Security and trigger expected actions.
- This helps verify that Defender is active and responding before rollout across multiple devices.
📌 Prerequisites:
- You will need Windows Security enabled and not restricted by policy.
- This requires at least one test file and a device where the context menu entries were recently added.
Steps:
- Right-click the desktop and select Show more options, then choose Windows Security.
- Confirm that the Windows Security dashboard opens without errors.
- Test individual modules such as Virus & threat protection, Firewall & network protection, or App & browser control to confirm full functionality.
- If you added the scan entry, right-click a known file and select Scan with Windows Security.
- Review Windows Security notifications or Protection history to verify that the scan completed and Defender logged expected activity.
⚠️ Things to look out for
| Risks | Potential Consequences | Reversals |
| Incorrect registry paths | The context menu entry will not appear or may break other shell items. | Verify the HKCR paths before deploying .reg files and confirm keys exist after import. |
| Defender disabled by policy or third-party AV | The Windows Security menu entry appears, but fails to open or run scans. | Check Defender status, review security policies, or adjust scan commands for your AV environment. |
| Entries missing after reboot or cleanup | Shell keys may be removed by security tools or overwritten by scripts | Reapply the registry entries and audit RMM or GPO settings that modify context menu keys. |
Troubleshooting Windows Security context menu options
- Entry does not appear: Check the DesktopBackground shell path, confirm the registry keys exist, and use Show more options in Windows 11.
- Windows Security does not open: Verify the Windows Security app is enabled and not disabled by policy or a third-party antivirus.
- Scan command fails: Confirm MpCmdRun.exe exists, Microsoft Defender is enabled, and the command path under the registry key is correct.
- Entries disappear after a reboot: Permissions, cleanup tools, or RMM scripts could be removing shell keys. In this case, reapply the entries and audit conflicting policies.
- The scan option is missing for some file types: Ensure the scan key is created under HKEY_CLASSES_ROOT\* rather than a file-specific extension key.
Streamline security workflows by customizing the Windows 11 context menu
Adding Windows Security to the desktop context menu gives administrators faster access to key protection features during troubleshooting or incident response. With simple registry edits and optional scripted deployment, you can standardize these entries across devices and maintain predictable behavior in managed environments.
Related topics:
- Navigating Windows Security: Identifying Your Windows Defender Version
- How to Hide or Show the Family Options Page in Windows Security in Windows 11
- How to Create a Windows Security Settings Shortcut in Windows 10
- How to Add or Remove “Pin to Start” from the Context Menu in Windows 11
- How to Add or Remove “Personalize” from the Desktop Context Menu in Windows 11