需要将其插入到bat文件中

发布于 2024-10-07 16:40:10 字数 176 浏览 0 评论 0原文

该脚本自动生成图像标签,但我需要将此命令放入 Windows bat 文件中。这段代码在cmd窗口中编写时工作正常。

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

感谢和问候

This script auto generates the image tag, but i need to put this command into a windows bat file. This piece of code works fine when written in cmd window.

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

Thanks and Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执手闯天涯 2024-10-14 16:40:10

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

试试这个:

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

MSDN 参考

In batch files you need to use %%variable format instead of %variable

Try this:

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

MSDN reference

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文