开发者

Can I stop an executable from requesting UAC elevation?

开发者 https://www.devze.com 2023-03-29 02:23 出处:网络
I have an installer I\'d like to run from a script.The installer requests UAC elevation but it doesn\'t need elevation because I\'m installing to a user directory.Is there some way to run the installe

I have an installer I'd like to run from a script. The installer requests UAC elevation but it doesn't need elevation because I'm installing to a user directory. Is there some way to run the installer so that it doesn't request UAC elevation?

The script is written in Python so I can access the Windows API through ctypes.

Changing the in开发者_JAVA百科staller is not an option.


You have to set the enviromnet variable __compat_layer for your process to RunAsInvoker. Then you can run the executable without any UAC prompt.

You can use the Windows API function SetEnvironmentVariable for this purpose.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号