Remove "Run As Different User" from context menus
Explanation
This setting controls whether "Run As Different User" appears on the Shift+RightClick context menu for .bat, .cmd, .exe, and .msc files.
Enabled (recommended): Keeps "Run As Different User" from appearing in the context menu when the user holds Shift while right-clicking on a .bat, .cmd, .exe, or .msc file in Explorer.
Disabled: Restores the Windows default behavior for "Run As Different User."
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer- Value name
- not defined in the ADMX
| State | Value written | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enabled |
| ||||||||||||||||||
| Disabled |
|
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: SecGuide/Pol_SecGuide_0301_RemoveRunasdifferentuser
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NoStartBanner' -Value 1 -Type DWord
$k = 'HKLM:\SOFTWARE\Classes\batfile\shell\runasuser'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'SuppressionPolicy' -Value 4096 -Type DWord
$k = 'HKLM:\SOFTWARE\Classes\cmdfile\shell\runasuser'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'SuppressionPolicy' -Value 4096 -Type DWord
$k = 'HKLM:\SOFTWARE\Classes\exefile\shell\runasuser'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'SuppressionPolicy' -Value 4096 -Type DWord
$k = 'HKLM:\SOFTWARE\Classes\mscfile\shell\runasuser'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'SuppressionPolicy' -Value 4096 -Type DWordDisable
# Disable: SecGuide/Pol_SecGuide_0301_RemoveRunasdifferentuser
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer'
Remove-ItemProperty -Path $k -Name 'NoStartBanner' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\batfile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\cmdfile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\exefile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\mscfile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinueRevert to "Not configured"
# Revert to "Not configured": SecGuide/Pol_SecGuide_0301_RemoveRunasdifferentuser
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer'
Remove-ItemProperty -Path $k -Name 'NoStartBanner' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\batfile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\cmdfile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\exefile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinue
$k = 'HKLM:\SOFTWARE\Classes\mscfile\shell\runasuser'
Remove-ItemProperty -Path $k -Name 'SuppressionPolicy' -ErrorAction SilentlyContinueApplication
Microsoft Security Baseline (MSS, SecGuide) (Microsoft) — November 2026 templates
Official templates downloaded on November 12, 2026.