Reputation: 45
simple Question:
i want to call the powershell with some commands from java. But the Problem is that no Window appears. i want that the window with the Powershell appears.
String[] str= {
"powershell.exe", "-NoExit", "-Command", "echo", "hallo"
}
[...]
Runtime.getRuntime().exec(str);
[...]
Upvotes: 1
Views: 1759
Reputation: 373
I was able to do it like this:
String[] str= { "cmd", "/c", "start", "powershell.exe", "-NoExit", "-Command", "echo", "hallo" };
Upvotes: 3