1

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);

[...]

1 Answers1

3

I was able to do it like this:

String[] str= { "cmd",  "/c", "start", "powershell.exe", "-NoExit", "-Command", "echo", "hallo" };
Mikkel K.
  • 373
  • 1
  • 10