Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone show me a good example of how to match it. Maybe I misread the documentation a bunch of times, but it does not even some close to how real tools like grep ought to work. The output of the following command, wmic /output:stdout csproduct get identifyingnumber looks like so.



wmic csproduct get identifyingnumber | findstr with parameters to remove column header | clip

I am not sure what to do because I cannot find an exact example of what I am looking for my batch file since I need the serial enough. Any thoughts?

EDIT: I like PowerShell, but I really need to know how to do this in batch (must be possible) for XP machines as well. I am just surprised I could not figure this out. I mean, this should be simple!

share|improve this question

use powershell do the following

gwmi win32_ComputerSystemProduct | ft IdentifyingNumber -hidetableheaders

share|improve this answer
Thanks, but was looking for something backwards compatible with some crappy XP images where PS is not installed. I appreciate it though. – ajstein Sep 19 '11 at 3:21
And I am a jerk. I forgot I tagged it win7 and not just windows. I changed that after the fact, but shame on me for not asking the question right! – ajstein Sep 19 '11 at 3:23
if you happen to have 1 win7 workstation you could still use the remote method! – tony roth Sep 19 '11 at 11:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.