Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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,将:替换为rem。事实上,代码块中似乎有一个标签,这通常是不允许的。Magoo给出了传统的答案-在括号中使用REM而不是: 但还有另一种选择。您可以在代码中的任何地方使用未定义的变量“扩展”,甚至在行的中间。“注释”只是扩展为空字符串 ) was unexpected at this time. Batch error 变量名中不能出现=,但未记录的动态伪变量除外,如%=ExitCode%和%=exitcodescii%。除了名称中的第一个字符外,=不能出现在任何地方。为了获得令人愉悦的视觉对

替换为
rem
。事实上,代码块中似乎有一个标签,这通常是不允许的。

Magoo给出了传统的答案-在括号中使用
REM
而不是

但还有另一种选择。您可以在代码中的任何地方使用未定义的变量“扩展”,甚至在行的中间。“注释”只是扩展为空字符串

) was unexpected at this time. Batch error
变量名中不能出现
=
,但未记录的动态伪变量除外,如
%=ExitCode%
%=exitcodescii%
。除了名称中的第一个字符外,
=
不能出现在任何地方。为了获得令人愉悦的视觉对称性,我在开头和结尾使用了一对,并且它保证永远不会与变量的名称匹配,无论内容如何

唯一的限制是您的“评论”不能包含
%

) was unexpected at this time. Batch error
set training_folder="%~1" %= business rules file is assumed to be in here =%