Windows .bat失败-问题在哪里 运行过程中运行批处理文件的原因是什么? < P> A退出>代码>语句将导致批处理文件提前终止。 < P>存在一些即时停止错误。 但是在你的特殊情况下,原因是未知的,就像代码一样 rem error1 - Invalid % Expansion rem %~ rem error2 - call REM /? set "switch=/?" call rem %%switch%% rem error3 - stackoverflow :stack call :stack rem error4 - call caret crash only with Vista set "caret=^" call echo %%caret%% rem error5 - Long expansion rem shows that expansion of % in a line is before the rem ignores the rest of the line rem The expansion results in a very long line with 10000 characters, the batch stops immediatly setlocal EnableDelayedExpansion set "longStr=." for /L %%c in (1,1,13) DO set longStr=!longStr:~0,2500!!longStr:~0,2500! rem Now we heave a string with 5000 characters, and build a rem line with 2 times 5000 = 10000 characters rem The next line crashes the batch file rem tokenOne %longStr% %longStr% ( ENDLOCAL goto :eof ) rem error 6 - %%var<LF> error, crashes only sometimes set critical_content=hello%%~^ echo $ for %%a in (1 ) do ( for %%x in (4) do ( rem #%critical_content%# ) ) rem错误1-无效的%Expansion 雷姆%~ rem error2-调用rem/? 设置“开关=/?” 调用rem%%开关%% rem error3-堆栈溢出 :堆栈 调用:堆栈 rem error4-仅在Vista中调用插入符号崩溃 设置“插入符号=^” 调用echo%%插入符号%% rem error5-长扩展 rem显示在rem忽略行的其余部分之前,行中%的扩展 rem扩展会产生一条10000个字符的很长的行,批处理会立即停止 setlocal EnableDelayedExpansion 设置“longStr=” 对于(1,1,13)中的/L%%c,请设置longStr=!朗斯特:~02500!!朗斯特:~02500! rem现在我们抛出一个包含5000个字符的字符串,并构建一个包含2倍5000=10000个字符的rem行 rem下一行使批处理文件崩溃 rem tokenOne%longStr%%longStr% ( 端部 后藤:eof ) rem错误6-%%var错误,仅有时崩溃 设置关键内容=hello%%~^ 回音$ (1)do中的%%a( 对于%%x in(4)do( rem#%临界含量%# ) )

Windows .bat失败-问题在哪里 运行过程中运行批处理文件的原因是什么? < P> A退出>代码>语句将导致批处理文件提前终止。 < P>存在一些即时停止错误。 但是在你的特殊情况下,原因是未知的,就像代码一样 rem error1 - Invalid % Expansion rem %~ rem error2 - call REM /? set "switch=/?" call rem %%switch%% rem error3 - stackoverflow :stack call :stack rem error4 - call caret crash only with Vista set "caret=^" call echo %%caret%% rem error5 - Long expansion rem shows that expansion of % in a line is before the rem ignores the rest of the line rem The expansion results in a very long line with 10000 characters, the batch stops immediatly setlocal EnableDelayedExpansion set "longStr=." for /L %%c in (1,1,13) DO set longStr=!longStr:~0,2500!!longStr:~0,2500! rem Now we heave a string with 5000 characters, and build a rem line with 2 times 5000 = 10000 characters rem The next line crashes the batch file rem tokenOne %longStr% %longStr% ( ENDLOCAL goto :eof ) rem error 6 - %%var<LF> error, crashes only sometimes set critical_content=hello%%~^ echo $ for %%a in (1 ) do ( for %%x in (4) do ( rem #%critical_content%# ) ) rem错误1-无效的%Expansion 雷姆%~ rem error2-调用rem/? 设置“开关=/?” 调用rem%%开关%% rem error3-堆栈溢出 :堆栈 调用:堆栈 rem error4-仅在Vista中调用插入符号崩溃 设置“插入符号=^” 调用echo%%插入符号%% rem error5-长扩展 rem显示在rem忽略行的其余部分之前,行中%的扩展 rem扩展会产生一条10000个字符的很长的行,批处理会立即停止 setlocal EnableDelayedExpansion 设置“longStr=” 对于(1,1,13)中的/L%%c,请设置longStr=!朗斯特:~02500!!朗斯特:~02500! rem现在我们抛出一个包含5000个字符的字符串,并构建一个包含2倍5000=10000个字符的rem行 rem下一行使批处理文件崩溃 rem tokenOne%longStr%%longStr% ( 端部 后藤:eof ) rem错误6-%%var错误,仅有时崩溃 设置关键内容=hello%%~^ 回音$ (1)do中的%%a( 对于%%x in(4)do( rem#%临界含量%# ) ),windows,batch-file,Windows,Batch File,正如其他人提到的,这是一个非常开放的问题,无法有效回答 不过,您可能希望了解是否需要使用CALL命令来调用另一个批处理脚本并将其返回到调用站点。请提供源代码、错误消息以及任何真正的。。。

正如其他人提到的,这是一个非常开放的问题,无法有效回答


不过,您可能希望了解是否需要使用
CALL
命令来调用另一个批处理脚本并将其返回到调用站点。

请提供源代码、错误消息以及任何真正的。。。