【问题标题】:Start a program that is in Program Files folder启动 Program Files 文件夹中的程序
【发布时间】:2018-04-23 19:34:12
【问题描述】:

我想用 java 启动一个 exe。
这个 exe 在 Program Files (x86) 文件夹中,当我尝试时:

Runtime.getRuntime().exec("C:\\Program Files (x86)\\CodFiscExtractor\\MySQLServer\\MySqlStart.exe");

控制台向我显示此错误:

CreateProcess error=740, The requested operation requires elevation 

我该怎么办?

编辑:这不是 this 的重复,因为我在问 java

【问题讨论】:

标签: java runtime exe


【解决方案1】:

我解决了,只是我这样写:

Runtime.getRuntime().exec("cmd /c \"C:\\Program Files (x86)\\CodFiscExtractor\\MySQLServer\\MySqlStart.exe\"");

现在我没有错误,但我有兴趣不要显示 UAC 窗口,因为MySqlStart.exe 以管理员权限开头。

【讨论】:

    猜你喜欢
    • 2015-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-03
    • 1970-01-01
    • 2012-07-12
    • 1970-01-01
    • 2012-02-22
    相关资源
    最近更新 更多