CK's BLOG
this site the web

To run Batch Script as Administrator can be a little challenge.

Sometimes you need batch script to run as administrator:

There is 2 alternatives:
1- Convert your batch script to exe and make exe run as administrator:


2- Add another batch script to open your batch script as administrator:

For example:

ExecuteDBBlank.bat will execute DBBlankExecution.bat as administrator but it requires you to enter password administrator:

 ExecuteDBBlank.bat
runas /noprofile /user:PC_NAME\Administrator C:\Users\COUK\Desktop\DBBlankExecution.bat

Where PC_NAME is your PC name and your main execution batch file can be located at any directory please update yours accordingly.

If we click on ExecuteDBBlank.bat it will ask you for Administrator password if you enter correctly DBBlankExecution.bat will be executed:




0 comments:

Post a Comment

Thanks for commenting...

 

Just An Information

I will updat useful information as frequent as I could...

Technology

Usage Policies