How do you call an exe from code and get around po

2019-06-14 02:55发布

I'm using system.diagnostics.process to start an msi file in quiet mode. I'm getting an exit code 1625, and I suspect its because UAC is preventing it from running. I've turned off the UAC prompts but no dice...

How can I make sure that I'm properly elevating the privileges of the msiexec so it actually runs?

Thanks,

Isaac

3条回答
爷的心禁止访问
3楼-- · 2019-06-14 03:25
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.Arguments = "/i " +  "\""+Directory.GetCurrentDirectory()+"\\"+msiPath +"\"" +" /q";
startInfo.FileName = "msiexec.exe";
startInfo.Verb = "runas";


Process installProcess = Process.Start(startInfo);

Well, this is what I did, and it works.

查看更多
Viruses.
4楼-- · 2019-06-14 03:28

Try running your process with the admin privileges and see if the problem persists

查看更多
登录 后发表回答