gsudo Guide: Elevate Privileges on Windows Like Linux sudo

gsudo: Windows’ sudo, Elevating Privileges Without That Damned Right-Click

One-sentence solution: Tired of opening a new administrator window every time you need to run a command that requires admin privileges? gsudo lets you just prefix your command with gsudo in your current window.

If you’ve used Linux or Mac, you’re probably familiar with sudo — prefix your command with sudo, enter your password, and the command runs with admin privileges. Elegant, direct, one line.

Back on Windows? You want to run a command that needs admin privileges: Open a new terminal window → Right-click → “Run as administrator” → Confirm the UAC prompt → Navigate back to your target directory → Finally, you can type your command.

Every single time. Annoying, isn’t it?

What is gsudo?

gsudo is the sudo command for Windows — a small tool that lets you execute commands with administrator privileges directly in your current terminal window.

The core problem it solves: No more opening a separate admin terminal each time — elevate privileges right in your existing window.

How Satisfying Is It to Use?

Scenario 1: One Command to Elevate

gsudo net start SomeService

That simple. Just prefix with gsudo, and the following command runs as administrator. No new window, no re-navigating to the directory.

Scenario 2: Enter Admin Shell

If you need to run multiple admin commands in a row:

gsudo

After executing this, your current shell becomes admin mode, and all subsequent commands are automatically elevated. Type exit to return to normal mode.

Scenario 3: Pipes and Redirection

gsudo dir > "C:\Program Files\test.txt"

Even if the target folder requires admin privileges to write to, adding gsudo handles it.

Comparison with Similar Tools

FeaturegsudoRight-click “Run as admin”sudo for Windows
UsageCommand prefixNeed new windowCommand prefix
Keep current directoryYesNo (goes to system32)Yes
Pipe supportYesNoLimited
Credential cachingConfigurableUAC every timeYes
Open sourceYesNoYes

gsudo is the most mature sudo implementation currently available on Windows.

Pros and Cons Summary

Pros

  • Simple to use — just add gsudo before your command
  • Keeps current working directory, no need to re-cd
  • Supports pipes and redirection
  • Caches credentials, no repeated UAC prompts for multiple elevations
  • Open source and free

Cons

  • Requires installation (unlike Linux’s built-in sudo)
  • First use triggers a UAC prompt
  • Occasionally has minor issues with very complex command chains
  • Not useful for users who rarely use the command line

Download and Installation

scoop install gsudo

Via Chocolatey

choco install gsudo

Direct Download

Tip: Installing via a package manager is recommended for easier updates.

Quick Start

  1. After installation, open PowerShell or CMD
  2. gsudo whoami /groups — Check your current privileges
  3. gsudo netstat -ano — Run network statistics with admin privileges
  4. gsudo — Enter admin mode, then execute multiple commands
  5. Type exit to leave elevation mode when done

Conclusion

gsudo is a “finally, it’s here” tool for every developer who uses the command line on Windows. It doesn’t solve some earth-shattering problem, but the few “right-click → Run as administrator” steps it saves you every day add up to real efficiency gains.

One-sentence summary: The sudo that Windows should have had all along.

Download

Some links on this page are affiliate links. We may earn a small commission at no extra cost to you. All recommendations are based on objective review.