I need a CMD script that is able to search through a text file based on a findstr
command that has multiple strings in it to be searched for.
In this case, I have created a text file (kb.txt) that contains the result of the command:
wmic qfe list
The script I need will read the file and searches through it with the findstr
command like:
findstr "kb3199321 kb3175631 kb3155567 kb3143345"
If the string is not found, it will output the string that is not found. The same goes for those that have been found. Example of output:
kb3199321 not found
kb3175631 found
kb3155567 found
kb3143345 not found
The script should loop through the findstr command for all its strings (not just the 4 listed above, it could be a few dozen to hundreds), and for each of them, echo if the string is found or not.
Note
If the findstr
command is too limited (where it can't search through more than a hundred strings), then the script should read off all the strings from another separate text file (e.g. "searchfile.txt"), then search through the "kb.txt" to see if it is able to find the strings, and echo the same wanted results as above