启动“程序文件"文件夹中的程序 [英] Start a program that is in Program Files folder

查看:120
本文介绍了启动“程序文件"文件夹中的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用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 

我该怎么办?

这不是

的副本,因为我要问 java

解决方案

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

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

现在我没有错误,但是我很奇怪不显示UAC窗口,因为MySqlStart.exe以管理员权限开头.

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

解决方案

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.

这篇关于启动“程序文件"文件夹中的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆