How to Elevate CMD to Admin on Windows: Step-by-Step
Windows UAC blocks file operations in restricted folders without admin rights. Since it’s lacking a native tool, this guide offers six methods to trigger UAC elevation in command prompts and batch files.

Best Tools to Elevate Command Prompt to Admin
1. NirCmd – Tiny but Mighty
NirCmd is a small command-line tool that can run over 100 tasks. For UAC elevation, just use its elevate
command. It’s perfect for running apps or scripts as admin straight from shortcuts or batch files.

Why it rocks:
- Only about 100KB
- Super easy to add to scripts or shortcuts
- No install needed
Heads up: No GUI or fancy features. Just raw functionality.
2. Gsudo – The sudo for Windows
Gsudo brings Linux-style sudo
commands to Windows. It elevates your command in the same terminal window, and it can even cache your credentials if you want.

Why it rocks:
- Works with CMD and PowerShell
- Doesn’t open a new window
- Optional password caching
Heads up: You’ll need to tweak a config file to enable password caching.
3. Elevate by Kai Liu – Ultra Lightweight
This one’s just a tiny 6KB tool. It runs a command with admin rights and can optionally keep the window open. It’s great for launching tools in scripts or via shortcuts.

Why it rocks:
- Super small and fast
- Comes with both 32-bit and 64-bit versions
- Perfect for script automation
Heads up: It comes zipped — use 7-Zip or another extractor.
4. RunElevated – Handy for Batch Files
RunElevated can run apps or scripts as admin via shortcuts or from right-click context menus. If you don’t pass a command, it even lets you pick something from a file browser.

Why it rocks:
- Great for batch files
- Easy to integrate into shortcuts
- Optional: open a new console with
cmd /k
Heads up: If your script runs too fast, you might miss the output unless you tweak it.
5. Elevate by Johannes Passing – Simple & Solid
Here’s another “elevate” tool — this one doesn’t rely on .NET and has a couple of nice options like keeping the console open and waiting for the process to end.

Why it rocks:
- Doesn’t need .NET
- Can wait for the process or keep the window open
- Clean and efficient
Heads up: No GUI or caching — but that’s also what keeps it lean.
Download Elevate by Johannes Passing
6. Use Built-in Tools: CMD & PowerShell
You don’t always need third-party stuff. PowerShell and CMD can do it too — just use Start-Process
with -Verb RunAs
.

Why it rocks:
- Built into Windows
- No downloads or installs
- Perfect for one-off admin jobs
Heads up: You’ll need to be careful with quotes if your command gets long.
Wrap-Up
Whether you’re a casual user or a power scripter, these tools let you dodge the UAC hassle while keeping your workflow smooth. NirCmd is great for tiny tasks, Gsudo gives you Linux vibes, and PowerShell’s always there if you’re going native.
Want help picking the right one for your setup? Just ask — happy to help.
I’ve written “gsudo” which behaves more like Unix Sudo… It keeps the current folder and runs the elevated commands in the current console window, so you don’t have to switch context. Check it out at: github.com/gerardog/gsudo
Awsome tool! I have been using “elevate” variants for some time, but migrated to “gsudo” after 5 min of trying. If you are using a Bash scripts on Windows, you need this.
Great!!! Thanks.
None of these methods work because UAC is set to always notify,
Please help
this is probably due to security..
I tried gsudo which is useful but I want to run part of a script without notification.
Is there a way to run it without UAC involvement?
There’s also Nircmd Elevate.
Thanks for this info, NirSoft app. about.