Board logo

标题: [其他] 【已解决】批处理命令for...in...do求助 [打印本页]

作者: chouxia    时间: 2014-11-16 13:52     标题: 【已解决】批处理命令for...in...do求助

本帖最后由 chouxia 于 2015-4-16 16:31 编辑

for /f %%z in ('findstr /s /i /m "del=0" *.txt') do (......)
如果条件符合del=0.程序运行。
如何在条件不符合的时候结束循环或者goto?
作者: DAIC    时间: 2014-11-16 15:41

  1. @echo off
  2. findstr /s /i /m "del=0" *.txt && goto yes || goto no
  3. goto end
  4. :yes
  5. echo 程序运行
  6. goto end
  7. :no
  8. echo 条件不符合
  9. goto end
  10. :end
  11. pause
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2