View Single Post
  #5   Spotlight this post!  
Unread 28-03-2012, 21:38
alberth alberth is offline
Programmer and Engineer
FRC #4067 (The Incredible Hawk)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Maryland
Posts: 9
alberth is an unknown quantity at this point
Re: Auto IP Batchfile

Quote:
Originally Posted by andreboos View Post
http://technet.microsoft.com/en-us/m.../ff431742.aspx

Not sure whether this works on batch files, though.
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.
__________________
Team #4067 - The Incredible Hawk
Role: Lead Programmer
Team Website

2012 Rookie Inspiration Award (Chesapeake Regional)

"You can't warm up by standing still in the frigid cold. Get moving!"