How can I find multiple values from windows command line output?
Example, to see if KB983590 is installed:
systeminfo | find "KB983590"
But what if I wanted to find out if more then one KB was installed?
Try this:
systeminfo | findstr "KB"
You can also use /i for case insensitive searching. Run findstr /? for even more options.
If you want to search for just a subset of patches, use spaces in between entries:
systeminfo | findstr "KB958488 KB976902 KB976932"
You can use a line like this:
FOR /F "usebackq tokens=5 delims= " %i IN (`netstat -ano ^|find "ESTABLISHED"`) DO @tasklist /fi "pid eq %i" | find "%i"
or, a bit shorter, this does the same:
netstat -a -b -n -o | findstr ESTABLISHED || tasklist | findstr PID