问题
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