Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Dos findstr help required
Name: jan (by janita) Date: June 11, 2008 at 02:57:13 Pacific OS: CPU/Ram: 512 Product: Vectra 400
Comment:
Hi,
I have a batch program which does some functionality and writes a log file. This log file will also contain errors if any. But the program always ends with an error level of 0.
I have added the following line findstr /c:Error "%BXT_LOG_FILE%" to find any lines with the word error. This is working fine and my sysout shows perfectly all error messages.
Now I want a condition to check if findstr returned error messages then set errorlevel as 1 else 0 and write this errorlevel to the same log file
Name: klint Date: June 11, 2008 at 04:05:16 Pacific
Reply:
DOS doesn't have findstr, so I presume you meant to say XP. Findstr returns 1 when it cannot find the string, and 0 when it does. This is the reverse of what you're asking, so you could do this:
if errorlevel 1 ( echo No errors! ) else ( echo Some errors were present. )
Summary: Why do you people cross examine everything? So i made a contradiction.. I was given /I found, totally irrelevant to the actual topic of the HELP required. I have built three computers myself but this ...
Summary: Hey all ColdFusion programmers out there. I am relatively new to ColdFusion and I have an issue. I have a web-based app that allows people to paste log files into a textarea on a CFM webpage. Usuall...
Summary: About your question regarding the Set command and strings I do not understand at all what is the trouble you are facing. About the IPConfig if you filter its output what you want may be achieved, so I...