Sudo for Windows in 24H2: Choose a Mode That Fits
Windows 11 24H2 adds Sudo for Windows. Check whether it has reached your PC, enable it, and choose a console mode that fits the command.
Need one Windows command to run as an administrator? Windows 11 version 24H2 includes Sudo for Windows, which lets you prefix a command in an unelevated console and approve the elevation through User Account Control (UAC). It starts that command with administrator rights; it does not turn the rest of your terminal session into an administrator shell. Read Microsoft's Sudo for Windows announcement for the command's documented behaviour.
Choose In a new window for your first run. It is the default and keeps the elevated command in its own console. Use Input closed when a non-interactive command should print into your current window. Use Inline only when a command needs keyboard input in that window and you understand the security trade-off.
As of 17 October 2024, the Windows 11 2024 Update is rolling out in stages. If version 24H2 has not reached your PC, Sudo may not be available yet. Microsoft's rollout notice explains why eligible devices can receive it at different times.
Check whether Windows 11 24H2 is installed
Press Win + R, type winver, and press Enter. Check whether Windows reports version 24H2. Microsoft's 24H2 update history lists Sudo among the features in this release.
If you still have 23H2, open Settings > Windows Update and wait for the normal update offer. Microsoft says the October rollout is phased according to device readiness and can be delayed by compatibility safeguards. Do not install an Insider preview just to get one command-line feature.
Enable Sudo and run a simple check
In Settings, open System > For developers and turn on the Sudo setting. Leave In a new window selected for the first run. Microsoft documented this settings path and the three mode choices in its Build 26052 release notes .
- Open a normal PowerShell or Command Prompt window, not an elevated one.
- Enter the read-only status command below. It is the example Microsoft uses in its announcement.
sudo netstat -ab UAC should ask you to confirm the elevation. Review the prompt and approve it only if it matches the command you entered. With the default mode, a separate elevated console opens and runs the command while your original console stays unelevated. These steps follow Microsoft's published documentation; they are not a report of an independent device test.
Choose the mode that fits the command
The modes change where the elevated process runs and whether it can use the current console's input. Microsoft's Sudo announcement describes the implementation and its security considerations.
| Mode | Where the command runs | Best fit and limit |
|---|---|---|
| In a new window (default) | Separate elevated console | Best starting point; keeps the regular console separate and supports normal interaction. |
| Input closed | Current console, with standard input closed | For non-interactive commands when you want their output in the current window. A command cannot accept typed input. |
| Inline | Current console, with input and output connected | For a command that needs interaction in the current window. It has the greatest documented console-sharing risk. |
Why Inline needs more care
All three modes still use UAC for approval. For Input closed and Inline, Windows connects the unelevated launcher and elevated process through console handles. Microsoft's engineering explanation warns that a medium-integrity process could drive the elevated process in these modes. Input closed mitigates that specific input risk by withholding the console input handle; Inline connects input, output and error to the current window.
That makes the choice practical: if a command needs no typed response, keep the default or use Input closed when same-window output matters. If it needs keyboard input, a separate new window is the cautious option. Choose Inline only when the interaction is necessary and you accept the documented risk. A UAC prompt does not make an unfamiliar command trustworthy.
If the setting or command is missing
First confirm the PC is on Windows 11 24H2 and check Windows Update for an offered update. The release rollout is phased, so an eligible device may not receive it immediately. On a work or school PC, check with its administrator before changing developer settings.
If you selected Input closed and the program waits for keyboard input, it cannot receive that input in this mode. Switch to In a new window if a separate console is acceptable; reserve Inline for cases that truly need the current window. If you need a whole elevated terminal session rather than one elevated command, use Windows' ordinary Run as administrator route.
The decision to remember
For a command that does not need input, start with In a new window. Choose Input closed when you want non-interactive output in the existing console. Use Inline only when the command needs to interact with you there. The command's actual needs are a better guide than choosing a mode because it resembles sudo on another operating system.
Microsoft references
Introducing Sudo for Windows (7 February 2024)
Windows 11 Insider Preview Build 26052 (8 February 2024)