开发者

How to run a program by disallowing its UAC settings

开发者 https://www.devze.com 2023-03-17 13:15 出处:网络
I have a autoit script that I am using for automation testing. My autoit script is called from a vb.net file. Dialog box of UAC settings will appear and is stopping the execution of test scripts. Curr

I have a autoit script that I am using for automation testing. My autoit script is called from a vb.net file. Dialog box of UAC settings will appear and is stopping the execution of test scripts. Currently I am trying process.startinfo.username and password to give specifically username so it may execute the script. Ple开发者_StackOverflowase guide how can I avoid that UAC during my tests execution.


Either change the script so that it doesn't need to be elevated or launch it from something that is already elevated. You'll need to consent once to elevate the "Something" then you should be ok. You can also use scheduled tasks to launch elevated things, and consent once when setting up the tasks, but not again when the task runs.


THe only way to avoid it is to sign your assembly with a strong key. There are instructions here on How to: Sign an Assembly. You must first purchase a code signing certificate though from a 3rd party. You can also make your own certificate but I am not sure if signing your code with a custom made certificate will make the UAC screen go away. I would try making your own certificate first and signing your assembly and seeing if that fixes the problem. If not, you can purchase a code signing certificate from several places, such as GoDaddy, VeriSign or from Thawte, just to name a few

0

精彩评论

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