Quote:
Originally Posted by andreboos
|
There are two ways to accomplish elevation via BATCH scripts.
1) Manifest file
You would need to convert the BAT script to an EXE. There are hundreds of programs and utilities to do that for you. One credible (but weird) method can be found
here.
Finally, you need to embed a special elevation manifest file into that EXE.
This article discusses the manifest's contents for getting an elevated privileges prompt. Again, there's some research involved, so beware.
2) External launcher
The ShellExecute API, with the "runas verb", will launch whatever program is in the arguments as an admin. I think there was a little EXE for exposing that API to BATCH scripters, but I seem to have lost it. Alternatively, if you know a little Python or a language that supports this API, you could create a program that exposes that API as well. (I'm a Python coder - if you need help for doing that, feel free to ask me and I'll provide you with my code!)
However, I found this program online called "Elevate":
http://www.winability.com/elevate/
I don't know how trustworthy this is, but it looks like it does the job.
