Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

systeminfo command

Status
Not open for further replies.

pmidwest

Programmer
Jan 9, 2002
162
US
I'm working with the systeminfo command in a batch file. The only problem is it outputs way to much stuff.

I was thinking of using

systeminfo /s server | find “Host Name:”

the only problem with this is I’d have to run systeminfo more than once to show all the things I need. So I tried outputting systeminfo to a txt file.

systeminfo /s server >server.txt

then I used find commands

find "Host Name:" <server.txt
find "OS Name:" <server.txt
find "OS Version:" <server.txt

This works ok… but I want to display everything except the huge list of hotfixs.

Is there any way to tell the script to just delete the hotfixs? Like delete after “hotfix(s):” and before “Network Card(s):” or just display all except for what’s in-between those sections.

Hope this make since.

Thanks,

P.
 
Figured it out...

systeminfo /s server >server.txt
findstr /v "KB Q File SP" <server.txt

Seems to work nice... it takes care of all the hotfixs but it also gets rid of the Page File option. That’s ok though.
 
Hey, thanks for the hint - I'm just learning batch files and that was very handy.

- stephan
 
I'm learning as well... I know my tag says (programmer). I don’t know why... nor how to change it... LOL... anyways are you doing network admin type scripts or what? I’ve built up a nice little script to help me out with some of my more tedious tasks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top