Start a program that is in Program Files folder

风格不统一 提交于 2019-12-24 14:37:12

问题


I want to start an exe with java.
This exe is in the Program Files (x86) folder and when I try :

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

the console displays me this error :

CreateProcess error=740, The requested operation requires elevation 

What I should do?

EDIT : this is not a duplicate of this, because i'm asking java


回答1:


I resolved, simply I writed like this :

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

Now I don't have error, but I am insterested to don't show UAC window, because MySqlStart.exe starts with admin privileges.



来源:https://stackoverflow.com/questions/49988681/start-a-program-that-is-in-program-files-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!