1
how to run a batch file from java using administrator privileges?
我想要做到这一点,但代码不工作。如何使用管理员权限从java运行批处理文件?
String cmd = "runas /profile /user:Administrator /cmd.exe /C certutil -addstore ROOT E:\\WORK\\UI\\DesktopRecorder\\userdata\\certgen\\X509CA\\ca\\new_ca.crt";
Runtime run = Runtime.getRuntime();
Process process = run.exec(cmd);
看看这里:http://stackoverflow.com/questions/19037339/run-java-file-as-administrator-with-full-privileges – DevilsHnd