How to run a batch file always as admin on Windows 11
Do you have a batch file that must run as admin? Use this trick to save some extra steps on Windows 11.
When you purchase through links on our site, we may earn an affiliate commission.Here’s how it works.
OnWindows 11, batch files can be useful for automatically creating and running one or multiple commands in sequence to perform different tasks. The only caveat is that some actions usually require running the batch with administrative privileges.
Some applications and file types usually include an option on the properties page to run as administrator, but that’s not the case for batch files. You can launch Command Prompt elevated to run the script or choose the option from the context menu, but these options can add some unnecessary extra steps and complexity for non-technical users.
If you want to configure a batch file to run as an administrator with a simple double-click, you can use a shortcut to do the trick.
In thishow-to guide, I’ll walk you through the steps to run batch files always elevated on Windows 11.
How to run a batch always as admin on Windows 11
If you need to run a batch file as an administrator with just a double-click, you’ll need to create a shortcut. This is because the properties page of this file format doesn’t include such an option.
Create batch file on Windows 11
To create a PowerShell script with Notepad, use these steps:
Get the Windows Central Newsletter
All the latest news, reviews, and guides for Windows and Xbox diehards.
@ECHO OFF
ECHO Hello World! This batch file always runs as admin.
PAUSE
Once you complete the steps, you can proceed to configure the batch file to run as administrator with a double-click action. If you’re getting started with batch files, you cancheck this guide to learn moreabout how to create and run these types of files.
Configure batch file to run as admin
To run a batch file always as an administrator on Windows 11, use these steps:
After you complete the steps, the next time you double-click the shortcut, the batch will run elevated on Command Prompt without needing extra steps.
The guide focuses on Windows 11, but you can also refer to these steps for previous versions of the operating system, including Windows 10, 8.1, and 7.
More resources
For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.