Windows 7 cmd
has no trouble executing ping -n 5 127.0.0.1 > nul
. Also, Runtime.getRuntime.exec(new String[]{"ping", "-n", "5", "127.0.0.1"})
works fine.
But Runtime.getRuntime.exec(new String[]{"ping", "-n", "5", "127.0.0.1", ">",
"nul"})
fails with Bad parameter >
. Why?
I'm using Java7 in Java6 mode.