将字符串传递给Windows命令行

use*_*481 5 java command-line process runtime.exec

请参阅下面的代码

Runtime rt = Runtime.getRuntime();  
rt.exec("cmd /c start");
String[] cmd = {"LogParser", "Select top 10 * into c:\temp\test9.csv from application" };
rt.exec(cmd);
Run Code Online (Sandbox Code Playgroud)

它会打开命令窗口,但打开后不会传入字符串.有人能告诉我为什么这段代码不会将字符串放入命令窗口?

Clo*_*ble 2

选项/C 的意思是:Carries out the command specified by the string and then terminates.

因此另一个命令被作为一个单独的命令处理。