tags:

views:

365

answers:

4

Has anyone managed to get administration rights through the UAC without restarting the application or embedding a manifest file?

I'd like to write to some files that only administrators can modify, without relying to another elevated application. Is it possible to impersonate an administrator previously calling with some native API the UAC prompt?

I guess this is not possible and I'll have to use an external tool with elevated rights, but I'm asking just in case.

EDIT: I know there are some other similar questions around, but since they do not cover the topic of impersonation (as fas as I've seen), nor some possible native call to the UAC prompt I decided to give a new thread a go...

+1  A: 

As stated in this other question, it is not possible, you have can eleveate COM object or another process, but not the current process.

http://stackoverflow.com/questions/17533/request-vista-uac-elevation-if-path-is-protected/17544#17544

heavyd
A: 

I read that thread (along with a lot more heh), but you never know what other people has managed to do recently. And maybe the release of SP2 changed something, dunno.

Neverbirth
A: 

Well, I guess there are no changes on how the UAC works nor any discovery on workarounds, so I'll mark the previous answer as the right one.

I'll make another application that performs the administrative tasks I need.

Thank you.

Neverbirth
A: 

Adding a manifest file in the same directory as the executable "works for me". Not actually getting the permissions, but it prompts for the permission.

anon