Configure the behavior of the sudo command: registry value EnabledComputerHKLM\Software\Policies\Microsoft\Windows\Sudo

Policy ID
EnableSudo
Scope
Computer Configuration
Supported on
At least Windows 11
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Category
System

Registry

Enabled

REG_DWORDComputer
Enabled value
Depends on the option value
Element
Maximum allowed sudo mode
Options
ItemStored value
Disabled0
Force new window1
Disable input2
Normal3
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Sudo]

; Options (use only one)
; Disabled
"Enabled"=dword:00000000
; Force new window
"Enabled"=dword:00000001
; Disable input
"Enabled"=dword:00000002
; Normal
"Enabled"=dword:00000003
CMD
:: Options (use only one)

:: Disabled
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 0 /f
:: Force new window
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 1 /f
:: Disable input
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 2 /f
:: Normal
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 3 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Force | Out-Null

# Options (use only one)
# Disabled
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 0 -Force | Out-Null
# Force new window
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 1 -Force | Out-Null
# Disable input
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 2 -Force | Out-Null
# Normal
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 3 -Force | Out-Null