Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 批处理文件以打开多个命令提示并执行同一任务_Batch File_Cmd - Fatal编程技术网

Batch file 批处理文件以打开多个命令提示并执行同一任务

Batch file 批处理文件以打开多个命令提示并执行同一任务,batch-file,cmd,Batch File,Cmd,我想要一个批处理脚本,它可以在一次单击中打开多个命令提示符,并反复运行相同的命令。我写了下面的代码,它只打开一个命令提示符并在那里停止。有没有办法做到这一点 for /l %%x in (1, 1, 5) do ( start cmd /c cd / && dir /s ) 它会打开不同的命令提示…它只是打开了命令提示,但没有运行命令。它应该是start cmd/c“cd\&dir/s&pause”,这样新手就不会感到困惑了。start/min c

我想要一个批处理脚本,它可以在一次单击中打开多个命令提示符,并反复运行相同的命令。我写了下面的代码,它只打开一个命令提示符并在那里停止。有没有办法做到这一点

   for /l %%x in (1, 1, 5) do (
    start cmd /c 
    cd / && dir /s
   )

它会打开不同的命令提示…

它只是打开了命令提示,但没有运行命令。它应该是
start cmd/c“cd\&dir/s&pause”
,这样新手就不会感到困惑了。start/min cmd/c batch1.bat&&start program1.exe start/min cmd/c batch2.batch&&start program2.exe
   for /l %%x in (1, 1, 5) do (
    start cmd /c "cd / && dir /s && pause"
   )