batch-file - For 循环批处理文件错误 : Do was unexpected at this time

标签 batch-file

我正在尝试使用批处理文件执行以下命令:

for /f %i in (D:\random\servers.txt) DO (d:\utils\tail -60 \\%i\c$\Windows\windowsUpdate.log | d:\utils\grep "updates detected" & set tx1234=%i)

它在命令提示符下单独调用时工作,但一旦我将它保存在批处理文件中,它就会失败并显示消息

Do was unexpected at this time



有任何想法吗?

最佳答案

批量使用%%i , 而在命令行中使用 %i

关于batch-file - For 循环批处理文件错误 : Do was unexpected at this time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17726011/

相关文章:

batch-file - 如何使用 CMD 在文件夹中创建子文件夹并移动其中创建的每 10 个文件?

arrays - 批量嵌套变量

for-loop - DOS - 尝试理解分隔符以找到最低行数的 inf 文件

windows - vbscript 按字母顺序插入一行

带有命令行 Blender 参数的 Python 脚本

java - 如何使用netbeans在java中运行批处理?

c# - 如何使用c#以管理员身份运行批处理文件来安装windows服务

windows - 以相反顺序循环目录中的文件

batch-file - 计算机列表中的 PSexec 文件速度加快

windows - 在 Windows 中将命令的输出重定向到文件而不换行