A.bat 与B.bat 怎么合并成一个BAT,让A执行了。再执行B

2024-11-22 12:02:55
推荐回答(4个)
回答1:

哦,我懂你的意思了,就是说让a.bat和b.bat同时运行
这个可以实现,用多线程

echo off
rem 公用的初始化命令请放在这上面
if "%~1"=="Starta" goto a
if "%~1"=="StartB" goto b
start "NewXianCheng" /b cmd /c "%~0" Starta
start "NewXianCheng" /b cmd /c "%~0" StartB
exit
:a
rem =====================================================
for /l %%a in (1,1,10) do echo.a1 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.a2 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.a3 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.a4 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.a5 %%a>>sdsad.txt
exit
rem 分割线内存放a.bat的内容
rem =====================================================
:b
rem 分割线内存放b.bat的内容
for /l %%a in (1,1,10) do echo.b1 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.b2 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.b3 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.b4 %%a>>sdsad.txt
for /l %%a in (1,1,10) do echo.b5 %%a>>sdsad.txt
exit
rem =====================================================

这是我写的例子,照搬吧

回答2:

这个合并就不知道了..但是你 到任务计划程序里设置任务,先让A.bat 执行,然後才是B.bat ,时间长短,相隔时间,要看你执行任务需要咯.

回答3:

把B的内容考进A,然后运行A就行,或者调用,,,

回答4:

call a.bat
call b.bat