我们一直在尝试使用JAVA的一个命令提示符下运行的连续指令。跑步系列在一个命令行命令,在cmd
Process process = runtime.exec("cmd.exe /c start cd c:\\program files (x86) && cd google && cd chrome && cd application");
就是我希望的是,它会做cd c:\\program files (x86)
,再cd google
然后cd chrome
然后cd application
。
当我运行的代码,它只是打开cmd并做第一个命令是cd c:\\program files (x86)
。
我知道你可以做到这一点cd c:\\program files (x86)\google\chrome\application
,而是因为我的实际命令行是客户的具体我使用这个作为测试,所以我不能使用,作为一个例子。
所以基本上,我需要连续运行一系列的命令行。