Switching application into administrator mode
Does anyone know how or if you can have an application switch into admistrator mode to run a particular section of code without having to launch it as a process that requests adminstrative privelages. This particular section, I want them to have to be an administrator to run, but I do not want to have to seperate it from the whole and then launch it as a seperate process.
Re: Switching application into administrator mode
I think the best solution, IMHO, would be to run the whole application with full admin rights, then there isn't ever a need to switch to admin mode; which I don't think is possible. :)
Re: Switching application into administrator mode
You should understand how to write a UAC compliant application.
http://download.microsoft.com/downlo...pplication.ppt
Re: Switching application into administrator mode
I dont want to "make" a new one, I want to do as little as possible to make an old one compliant, there is quite a large differance.
At any rate the slides did answer the question, there is no way to elevate a running process, so the only way is to seperate the code into a new EXE and launch it as a seperate process, since I still want to force the user to have admin privelages to run this particular section.
Re: Switching application into administrator mode
Quote:
I dont want to "make" a new one, I want to do as little as possible to make an old one compliant, there is quite a large differance.
I'm sorry, I didn't mean to imply you need to make a new application. You can make your application UAC compliant by reading the link I supplied and make the changes to your current app.
Re: Switching application into administrator mode
There is no way to switch it into admin mode within the process. Its from another process, so as another exe, and then may be you can use params to "switch back" to your old compliant one.
Re: Switching application into administrator mode
All you need to do ( firstly ) is to create a manifest file for your application, as explained in slide 24, then take it from there. No need to create a new app. :)