Batch file 需要将其插入bat文件中吗

Batch file 需要将其插入bat文件中吗,batch-file,Batch File,这个脚本自动生成图像标记,但是我需要将这个命令放入一个windows bat文件中。这段代码在cmd窗口中编写时工作良好 FOR %i IN (*.JPG) DO ECHO ^<img src="%i" /^> >> index.html (*.JPG)DO ECHO^>>index.html中%i的 感谢和问候在批处理文件中,您需要使用%%variable格式而不是%variable 试试这个: FOR %%i IN (*.JPG) DO ECHO ^<img

这个脚本自动生成图像标记,但是我需要将这个命令放入一个windows bat文件中。这段代码在cmd窗口中编写时工作良好

FOR %i IN (*.JPG) DO ECHO ^<img src="%i" /^> >> index.html
(*.JPG)DO ECHO^>>index.html中%i的


感谢和问候

在批处理文件中,您需要使用%%variable格式而不是%variable

试试这个:

FOR %%i IN (*.JPG) DO ECHO ^<img src="%%i" /^> >> index.html
(*.JPG)DO ECHO^>>index.html中%%i的


在批处理文件中,您需要使用%%variable格式,而不是%variable格式

试试这个:

FOR %%i IN (*.JPG) DO ECHO ^<img src="%%i" /^> >> index.html
(*.JPG)DO ECHO^>>index.html中%%i的