Windows Batch File Run As Administrator

A batch file includes the commands to be executed by Command Prompt in Windows 10 (and older versions). I have already explained what is a batch file and how to create your own.

However, you’ll require administrator privileges for your batch file to run some commands in the Windows Command Prompt.

In this article, I am going to tell you how to enable ‘Run As Administrator’ option for a batch file in Windows. This simple trick will save your efforts of using the right-click to enable Run As Administrator command prompt every time.

How to run a batch file as Administrator in Windows 10?

Here, I am using Windows 10 to show the process of automatically running a batch file with Windows admin rights. However, the method works on older versions including Windows 7 and Windows 8/8.1 as the concept of batch files has existed for a long time.

Anyway, follow the steps mentioned below:

  1. Right-click on your batch file.
  2. Click Create Shortcut.
    batch-file-run-as-administrator-1
  3. Right-click the shortcut file. Click Properties.
    batch-file-run-as-administrator-2
  4. In the Shortcuts tab, click Advanced.
    batch-file-run-as-administrator-3
  5. Check the Run As Administrator box.
    batch-file-run-as-administrator-4
  6. Click Ok to close the dialog box.
  7. Click on Apply to save the changes. Click Ok to close Properties.

Now, every time you run the shortcut file by double-clicking it, the Windows UAC message will be displayed. Click Ok to run as administrator in Windows. This is required as commands would require the access of more system-level components that are not available when you open CMD in user mode.

Did you find this helpful? Tell us in the comments below.

Also Read:The Ultimate A to Z List Of Windows CMD Commands You Need To Know
SHARE
Aditya Tiwari
Aditya likes to cover topics related to Microsoft, Windows 10, and interesting gadgets. But when he is not working, you can find him binge-watching random videos on YouTube (after he has wasted an hour on Netflix trying to find a good show). Reach out at [email protected]