How can you tell if a program needs elevated rights?
Imagine the following scenario:
I have an exe file "DoINeedAdmin.exe" somewhere and want to check if this program will require administrator rights to run it.
It would be nice to try and run it and define it with some kind of failure return value.
Since Windows can obviously do this by adding an admin icon to the exe if it needs elevated privileges, I hope it is possible programmatically as well.
source to share
In short, there is no right way.
Windows will run the elevated program if it is listed in its manifest. They will also run it if the program name contains Install, Install, Update, Patch (possibly more) (unless disabled by local policy or manifest file ).
In addition, the application can also request elevation from code. There is no way to detect this in an external program.
source to share
In short: Application Manifest . It is an XML file embedded in the executable and in particular the tag exists <requestedExecutionLevel level="requireAdministrator" />
.
source to share