Find multiple lines with | find in cmd

I am trying to make a batch file to run the systeminfo on Windows 7 and narrow down the results so as not to show the Hot Fix Information, or just some specific lines.

Is there a way to do this without writing a command multiple times? Ie, right now, I have the following:

 systeminfo|find "System Boot Time" systeminfo|find "Host Name" systeminfo|find "OS Name" 

and etc.

The problem is that it needs to reload all the information from systeminfo cmd for each new line, which makes it pretty long. Is it possible to simply run the command once and find | find stretching multiple lines?

If not, is it possible to delete the information using another command? (I have not heard anything like it, but not sure if it does not exist)

+4
source share
1 answer

You can use this:

 @ECHO OFF &SETLOCAL systeminfo|findstr /c:"System Boot Time" /c:"Host Name" /c:"OS Name" 

See here for more information on findstr .

+7
source

Source: https://habr.com/ru/post/1490140/


All Articles