Batch file 循环的批处理文件有语法错误
我有一个带有Batch file 循环的批处理文件有语法错误,batch-file,Batch File,我有一个带有的批处理for循环,该命令的语法不正确错误。 我正在看一份文件 setlocal EnableDelayedExpansion set /a filecnt=1 set /a emptylist=1 for /f "delims= " %%x in ('type "%execution_list_file%"') do ( set /a emptylist=0 echo File number !filecnt! >> %logfile% 2>&
的批处理for循环,该命令的语法不正确错误。
我正在看一份文件
setlocal EnableDelayedExpansion
set /a filecnt=1
set /a emptylist=1
for /f "delims= " %%x in ('type "%execution_list_file%"') do (
set /a emptylist=0
echo File number !filecnt! >> %logfile% 2>&1
set /a sleepcnt=0
set /a found=0
::call :lookup
set /a filecnt=!filecnt!+1
)
我的文件中有一组文件路径,如下所示:
\\VDI\Prod\Dataloads\PROD\FileName01.csv
\\VDI\Prod\Dataloads\PROD\FileName02.csv
我的语法有什么问题?当它用于注释代码时,:
在技术上是一个标签
由于批处理解析代码的方式,当代码块中有标签时,代码块会这样做
当您在for
循环、多行if
语句和其他用括号括起来的代码行中时,您应该使用rem
进行注释。更改::call
到rem call