嗨,我想分两批处理脚本并将它们合并为一个。我也想要现在的“One”批处理文件以降序运行。如何合并两个批处理脚本,将它们放到一个批处理文件中并以降序运行
我能够但是使用CALL
功能,那么我有三个批处理文件。
我试图将它们结合起来并达到相同的结果,我想如果我不得不从callbatchA + batchB.bat运行batchA.bat和batchB.bat文件
如callbatchA + B.batch ,batchA.bat,batchB.bat
我通过运行concatfile.bat包括以下
copy callbatchA+B.bat+batchA.bat+batchB.bat combined_.bat
这并没有尝试过的文件的简单concat
下面
::CallScript
CALL C:\Users\Myname\Desktop\batchA.bat
CALL C:\Users\Myname\Desktop\BatchB.bat
::ScriptA
@echo off
setlocal EnableDelayedExpansion
CD "C:\deviceno\"
::only change these three lines
set "start=295" ::starts from this number
set "amount=10" ::amount of files created
set "length=5" ::
set /a "last=%start%+%amount%"
for /l %%i in (%start%,1,%last%) do (
set "folderName=0000000000%%i"
set "folderName=!folderName:~-%length%!"
md "!folderName!"
)
pausefor
::ScriptB
/D %%a in ("C:\deviceno\*.*") do xcopy /y /d C:\Source\*.*"%%a\"
concatenated
文件将不起作用的例子,我试图与goto :eof
这样的编辑代码如下但到目前为止,我有没有运气。
::ScriptA
@echo off
setlocal EnableDelayedExpansion
CD "C:\device_numbers\"
::only change these three lines
set "start=295" ::starts from this number
set "amount=10" ::amount of files created
set "length=5" ::
set /a "last=%start%+%amount%"
for /l %%i in (%start%,1,%last%) do (
set "folderName=0000000000%%i"
set "folderName=!folderName:~-%length%!"
md "!folderName!"
) DO CALL ::ScriptB
::ScriptB
p /D %%a in ("C:\device_numbers\*.*") do xcopy /y /d C:\Source\*.*"%%a\"
goto :eof
完美,谢谢! – Jonas