You can perform a number of tasks on your Windows computer by running commands. These commands work very well. Some people also try to execute a number of these commands one by one. This mass execution of commands helps them get better output. But writing and executing these commands one by one manually takes a long time.
To counter this, Microsoft has added runtime functionality Batch files on their operating systems. These batch files are also executed by a number of background software to perform multiple tasks. But if you are running an independent script, you might need administrator-level privileges to run them. This is what we will talk about in the guide.
If you want to run a batch file as an administrator only once, just right click on the batch file you want to run and select Run as administrator.
It will start running this batch file with administrator rights.
Always run the batch file as an administrator in Windows 10
If you want to automatically elevate a batch file and run it as an administrator, do the following:
- Locate the batch file
- Right click on the batch file
- Select Create shortcut
- Give it an appropriate name
- Now right click on the shortcut file
- Click on Properties.
- Select the Shortcuts> Advanced tab.
- Select the Run as administrator check box.
- Click OK / Apply and exit.
Now, every time you run the shortcut, the batch file will always be Run as administrator.
That’s it!