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
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.
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
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_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 DWordDisable
# 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 DWordRevert to "Not configured"
# Revert to "Not configured": EdgeUI/ShowCommandPromptOnWinX
$k = 'HKCU:\Software\Policies\Microsoft\Windows\EdgeUI'
Remove-ItemProperty -Path $k -Name 'ShowCommandPromptOnWinX' -ErrorAction SilentlyContinue