Run a batch file as an Administrator automatically

Difficulty Level:    

The following script helps to execute a batch file as an administrator (request administrator access inside a batch file). This script does the trick! Just paste it into the top of your bat file.


Son Nguyen

Son Nguyen

Son Nguyen is a Cloud Consultant working for FPT Software’s Cloud Innovation team. With deep knowledge in AWS and MS Azure, Son acts as a cloud consultant in various areas, ranging from assessment to architecture design, supporting customers from Japan, EU to US.

You may also like...

1 Response

  1. Henning Weltz says:

    Hi Son,
    This .bat runs fine when I double click it from a folder. But when I try to execute it from inside my VB6 executable like this: “( Shell
    >> “C:\SAHL\Executable\RegisterAllAsAdministrator.bat” ‘ hww 21092016
    >> Log 181)” it simply loops forever and I have to switch my PC off to recover.
    Any ideas on how to overcome this?

Leave a Reply

Your email address will not be published. Required fields are marked *