例如:查找文件a.txt中的内容,如果找到字符:dos,显示:dos have found。否则显示:dos have not found 作者: kavenlee72 时间: 2005-1-16 00:00 我也想这样用,但是为什么没有高手肯赐招呢?换种方法也行,只要功能一样。作者: GOTOmsdos 时间: 2005-1-16 00:00 用find,很简单的
@echo off
find "dos" 路径\a.txt>null (这里,如果想把找到的字符保存进文件,可以把null换成文件名)
if not errorlevel 0 echo dos not found
if errorlevel 0 echo dos have found