Question

Locked

Request UAC elevation at runtime?

By Slayer_ ·
I have a legacy VB6 Program that occasionally needs UAC elevation to do some things (mostly copying OCX's and DLL's to system folders).
However, this is only 5% of its function, the rest does not require UAC.
Is it possible to code it to request UAC elevation only when needed, thus not needlessly prompting the user for UAC each time the program is run?

I did find on the internet, some people wrote an elevation command, the problem with this is that it causes each OCX and DLL to require a UAC prompt (about 30 of them each time) so this is no good.

I'd also rather not recursively run the program, the program shelling to itself but with elevation, that could get nasty.

Anyone got any ideas?

This conversation is currently closed to new comments.

12 total posts (Page 2 of 2)   Prev   01 | 02
Thread display: Collapse - | Expand +

All Answers

Collapse -

Reponse To Answer

by seanferd In reply to As seanferd suggested

For XP? Absolutely. I was just curious.

Collapse -

Service?

by oldbaritone In reply to Request UAC elevation at ...

Can you segment the UAC-dependent processes out and create them as a service? Set them for on-demand start and then call to the service from the non-elevated portion of the program to request the service to perform the UAC-dependent functions?

Just blue-sky brainstorming on a Friday morning

;-)

Back to Networks Forum
12 total posts (Page 2 of 2)   Prev   01 | 02

Related Discussions

Related Forums