Request UAC elevation at runtime? - TechRepublic
Question
October 19, 2011 at 08:17 AM
slayer_

Request UAC elevation at runtime?

by slayer_ . Updated 14 years, 8 months ago

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 discussion is locked

All Comments