UAC is a good security feature and a terrible automation feature. When an AI agent or script needs to perform an elevated action on Windows, the standard elevation path stops the flow with a prompt that only a human can answer. For headless automation, that is a dead end.

The scheduled-task trick

winsudo elevates a child process by creating a one-shot scheduled task with the highest run level, triggering it, polling for completion, and cleaning it up. The result is an elevated execution with no UAC dialog, suitable for automation contexts where a human is not available to click through.

Use it from agents and shells

The MCP tool run_elevated accepts a script and runs it elevated, returning the output. The CLI winsudo <script> does the same from a shell. Both keep the elevation scoped to the single command rather than leaving an elevated session open.

Honest about limits

Elevation still requires that the calling user has the right to create scheduled tasks. On a machine where that is not permitted, winsudo reports the limitation rather than silently failing. The repository documents the requirements and the trade-offs.

Explore winsudo · Source and documentation

PUT THE STORY INTO PRACTICEExplore winsudo
Have a project in mind?