首页 > 解决方案 > 批处理脚本何时不执行除错误之外的所有命令

问题描述

我写了一个批处理脚本,成功执行了别人的命令,但是我后面的命令没有继续。为什么?我的脚本:

cd /d "%~dp0"
echo %cd%
set Param=%1%
set resultDir=..\build\UnityXXXXX-%Param%-Mac

echo start build Editor
: This line is executing someone else's script!!!!!!!!
.\jam Editor -sCONFIG=release
: The previous script finishes executing without any error, but even then, the later scripts will not continue to execute!!!!!!!!

echo start copy to build dir
if not exist .\build\WindowsEditor\Unity.exe (
    echo the Unity is not build, build it first.
    pause
    exit
)
if exist %resultDir% rd /s /q %resultDir%
md %resultDir%
xcopy /s ..\UnityXXXXX\* %resultDir%\
xcopy .\build\WindowsEditor\Unity.exe %resultDir%\Contents\Unity.exe*

echo finish
pause

这张图是运行的结果,在这里可以看到,执行成功了,但是我后面脚本的echo没有输出,没有执行 在此处输入图像描述

标签: windowsbatch-filecmd

解决方案


推荐阅读