简单问题:
我想用java中的一些命令调用powershell。但问题是没有出现任何窗口。我希望出现带有 Powershell 的窗口。
String[] str= {
"powershell.exe", "-NoExit", "-Command", "echo", "hallo"
}
[...]
Runtime.getRuntime().exec(str);
[...]
最佳答案
我能够这样做:
String[] str= { "cmd", "/c", "start", "powershell.exe", "-NoExit", "-Command", "echo", "hallo" };
关于java - Powershell 打开窗口(来自 Java.Runtime.exec),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25530774/