-
July 16th, 2010, 06:54 PM
#1
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.
--------------------------------------------------------------------------------------------------------------------------
Disclaimer - Most likely any code I have posted as an answer was most likely written free hand and may have some minor compile errors, and is merely intended to give you the idea.
-
July 17th, 2010, 03:07 AM
#2
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.
-
July 17th, 2010, 07:46 PM
#3
Re: Switching application into administrator mode
You should understand how to write a UAC compliant application.
http://download.microsoft.com/downlo...pplication.ppt
-
July 19th, 2010, 01:10 PM
#4
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.
Last edited by matthewsanford@gmail.com; July 19th, 2010 at 01:21 PM.
--------------------------------------------------------------------------------------------------------------------------
Disclaimer - Most likely any code I have posted as an answer was most likely written free hand and may have some minor compile errors, and is merely intended to give you the idea.
-
July 19th, 2010, 01:49 PM
#5
Re: Switching application into administrator mode
Originally Posted by matthewsanford@gmail.com
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.
-
July 19th, 2010, 06:52 PM
#6
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.
-
July 20th, 2010, 01:13 AM
#7
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|