Open in the explorer

Prevent users from replacing the Command Prompt with Windows PowerShell in the menu they see when they right-click the lower-left corner or press the Windows logo key+X

Empêcher les utilisateurs de remplacer l’invite de commandes par Windows PowerShell dans le menu affiché quand ils cliquent avec le bouton droit dans l’angle inférieur gauche ou qu’ils appuient sur la touche Windows+X

Type
User
GPO path
User Configuration › Policies › Administrative Templates › Windows Components › Edge UI FR: Configuration utilisateur › Stratégies › Modèles d'administration › Composants Windows › Interface utilisateur latérale
Supported on
At least Windows Server 2012 R2, Windows 8.1 or Windows RT 8.1 FR: Au minimum Windows Server 2012 R2, Windows 8.1 ou Windows RT 8.1
ADMX file
EdgeUI.admx
Internal name
EdgeUI/ShowCommandPromptOnWinX

Explanation

This policy setting allows you to prevent users from replacing the Command Prompt with Windows PowerShell in the menu they see when they right-click the lower-left corner or press the Windows logo key + X.

If you enable this policy setting, the Command Prompt will always be listed in that menu, and users won't be able to replace it with Windows PowerShell. Users will still be able to access Windows PowerShell, but not from that menu.

If you disable or don't configure this policy setting, Command Prompt will be listed in the menu by default, and users can configure this setting.

French text from Windows 11 26H2

Ce paramètre de stratégie vous permet d’empêcher les utilisateurs de remplacer l’invite de commandes par Windows PowerShell dans le menu affiché quand ils cliquent avec le bouton droit dans l’angle inférieur gauche ou qu’ils appuient sur la touche Windows+X.

Si vous activez ce paramètre de stratégie, l'invite de commandes figure toujours dans ce menu et les utilisateurs ne peuvent pas la remplacer par Windows PowerShell. Les utilisateurs peuvent toujours accéder à Windows PowerShell, mais pas depuis ce menu.

Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, l’invite de commandes figure dans le menu par défaut et les utilisateurs peuvent configurer ce paramètre.

Registry

HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI
Value name
ShowCommandPromptOnWinX
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

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: EdgeUI/ShowCommandPromptOnWinX
$k = 'HKCU:\Software\Policies\Microsoft\Windows\EdgeUI'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ShowCommandPromptOnWinX' -Value 1 -Type DWord

Disable

# Disable: EdgeUI/ShowCommandPromptOnWinX
$k = 'HKCU:\Software\Policies\Microsoft\Windows\EdgeUI'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ShowCommandPromptOnWinX' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": EdgeUI/ShowCommandPromptOnWinX
$k = 'HKCU:\Software\Policies\Microsoft\Windows\EdgeUI'
Remove-ItemProperty -Path $k -Name 'ShowCommandPromptOnWinX' -ErrorAction SilentlyContinue

Availability