Sudo on Windows 11 23H2: Supported Elevation Options and Version Limits
Windows 11 version 23H2 does not include Microsoft's built-in Sudo for Windows. That feature requires Windows 11 version 24H2 or later. A registry setting or a command prefix cannot add the supported feature to 23H2.
Windows can still launch a separate elevated process from an ordinary console. You do not have to elevate your original terminal session, and Linux sudo inside WSL is a different tool.
Check Which Windows Version You Have
Run winver from Start or the Run dialog and read the version. If the PC is managed, follow its administrator's update and elevation policies. For an upgrade, use the supported release offered to your device through Windows Update.
On 23H2: Open an Administrator Terminal
For occasional maintenance, search for PowerShell or Terminal in Start, choose Run as administrator, and complete the User Account Control prompt. An administrator may receive a consent prompt; a standard user may need authorized administrator credentials, depending on policy.
Run only the commands that need elevation, then close that window. Starting a program as administrator gives that process and relevant child processes elevated rights; it does not grant every ordinary application on the desktop the same access.
Launch One Elevated Process from PowerShell
PowerShell's Start-Process command can request elevation using the RunAs verb. For example, this opens a separate administrator Command Prompt and runs a command that lists active connections and associated executables:
Start-Process -FilePath 'cmd.exe' -Verb RunAs -ArgumentList '/k netstat -ab'
The UAC prompt still applies. The /k option leaves the new Command Prompt open so you can read the output; close it afterward. This does not elevate the original PowerShell window or return the command's output inline there. For another command or a script path containing spaces, construct and quote the arguments carefully rather than pasting them into this example unchanged.
Microsoft documents this elevation mechanism in Start-Process. A script that relaunches itself must also handle its arguments, working directory, PowerShell version and cancellation. A short self-elevation snippet is not a universal solution for all scripts.
Why runas.exe Is Different
The command-line program runas.exe primarily starts a program using another account. That is different from requesting an elevated token through UAC. Choosing an account that belongs to Administrators does not make every runas.exe invocation equivalent to Run as administrator.
Do not enable the built-in Administrator account merely to use a sudo-style workflow. The earlier claim that runas has no credential-saving option was also incorrect: Microsoft documents /savecred, although availability and policy restrictions apply. Saving credentials has security implications and is unnecessary for the UAC workflow above. See Microsoft's runas command reference.
On 24H2 or Later: Use Built-In Sudo
Microsoft's Sudo for Windows documentation lists Windows 11 24H2 or later as the prerequisite. On current builds, enable it under Settings > System > Advanced > Enable sudo; older layouts may place the setting under For developers.
The default mode opens a new window. Other modes support closed input or inline execution, with additional security considerations. After enabling the feature, a documented example is:
sudo netstat -ab
Sudo for Windows requests elevation through UAC. It does not turn Windows into a Linux permissions environment or bypass authorization. Use the default new-window mode unless you understand the other modes' risks.
WSL Sudo Elevates Linux Commands
Inside a Linux distribution, sudo can run Linux administrative commands using the distribution's account and permissions. Linux root is not the same as Windows administrator. Installing WSL therefore does not make sudo a general solution for elevating Windows applications or changing Windows system settings.
Use WSL when you need Linux tools. Microsoft's WSL environment guide explains its Linux account setup.
Choose the Appropriate Method
- On 23H2, use Run as administrator or PowerShell Start-Process with RunAs for Windows elevation.
- On a supported newer release, enable Microsoft's Sudo feature if it suits your workflow.
- For Linux administration, use sudo inside the relevant WSL distribution.
- For recurring administrative automation, use a deliberately configured task with restricted permissions. A scheduled task is not a general-purpose silent sudo replacement.
Keep UAC enabled and request elevated rights only for work that needs them. If elevation is blocked by device policy, contact the administrator rather than trying to force it.