我正在尝试使用批处理文件执行以下命令:
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/