Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
Computer Hope forum e-mail issues and down time
0 Members and 1 Guest are viewing this topic.
find /i "string" filenameif errorlevel 0 do echo string unfound
So would this work.Code: [Select]find /i "string" filenameif errorlevel 0 do echo string unfound
Quote from: BatchFileCommand on January 18, 2009, 07:44:41 PMSo would this work.Code: [Select]find /i "string" filenameif errorlevel 0 do echo string unfound Suggestion: try it and see.
Suggestion: try it and see.
QuoteSuggestion: try it and see.I was looking for a more direct answer
it doesn't work.
Unfortunately I turn echo on and there is no error message. I just took a random guess with the errorlevel.Besides, Dias, why are you always this "I know everything" guy who has no "patience" .
@echo offfind /i "bb" computers.txtif errorlevel 0 do echo string unfound
C:\>tme---------- COMPUTERS.TXTbb'do' is not recognized as an internal or external command,operable program or batch file.
Oh yeah, I took away the do shortly after the first post. Should've edited and took that out. So, any other reason it shouldn't be working?
find /i "text" fileif not errorlevel 0 (echo found) else (echo unfound)pause>nul
find /i "text" filename.extif %errorlevel% EQU 0 (echo found) else (echo not found)