How to find if a file contains a given string using dos command line -


i trying create batch (.bat) file windows xp following:

if (file.txt contains string 'searchstring') (echo found it!)  else(echo not found) 

so far, have found way search strings inside file using find command returns line in file finds string, unable conditional check on it.

for example, doesn't work.

if find "searchstring" file.txt echo found it! 

nor this:

if find "searchstring" file.txt=='' echo not found 

any ideas on how can done?

watch post.
accepted solution seems right 1 too.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -