How to open an admin console by using the start command …cmd /C in a batch file?

A

AndiMzD

Hello,

in a batch file I use the start command which opens a command shell and passes my batch file to this cmd.

My Batch file is named Run my query.bat It contains this:

Start "This
script runs my query" \windows\system32\cmd /C c:\mypath\myquery.bat


In order that the command shell closes at the end I have to open it by using cmd with the /C switch.

I would not need the path to the cmd as it is in the path anyway. I just tried that because I figured perhaps that would lead to an admin console window. But it does NOT.

I know how to open an admin command shell manually. That is not the point here. The point is to open an admin console from within a batch file as here using start with cmd /C

I do not see any chance to accomplish this. Is it true that an NT shell script admin console window can never be opened from within a batch file?

Thank you.


Andreas

Continue reading...
 
Back
Top Bottom