findstr退出代码/ errorlevel

RC_*_*r07 9 cmd exit-code errorlevel findstr

我有一个正在使用的程序,findstr当找到字符串时errorlevel返回0,当找不到字符串时errorlevel返回1.好吧,我可以解决这个问题.

问题出在哪里,我找不到任何关于每个errorlevel方法的官方文件findstr.我需要知道,如果别的了findstr所能返回errorlevel1,或者如果它只返回1时找不到字符串.

如果有"官方"文档的链接是首选,但任何输入都将非常感谢.

提前致谢!

Ste*_*han 10

http://ss64.com/nt/findstr.html说:

FINDSTR will set %ERRORLEVEL% as follows:

0 (False) a match is found in at least one line of at least one file.
1 (True) if a match is not found in any line of any file, (or if the file is not found at all).
2 Wrong syntax 
An invalid switch will only print an error message in error stream.
Run Code Online (Sandbox Code Playgroud)