Imagine the following scenario:
I have an exe-file "DoINeedAdmin.exe" somewhere and want to check if this program would require admin-rights to start it.
It would be okay trying to start it and determine it by some failure return value.
Since Windows can obviously do this by adding the admin-icon to the exe if it needs elevated rights, I hope it's possible programmatically too.
There is a undocumented function in shell32 (ordinal 865) that takes a LPCWSTR path and returns a non-zero BOOL if the path requires elevation. I don't know if this function checks external manifests though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With