Find XP Computers on a network with Batch file

Hello experts,

I am trying to write a batch file and use nmap.exe to find XP machines on the network. The batch file executes:

(I downloaded zenmap)

C:\program files\nmap.exe -F -O > XPList.txt

Sample export is:

Nmap scan report for (
Host is up (0.00076s latency).
All 100 scanned ports on  ( are filtered
Warning: OSScan results may be unreliable because we could not find at least 1 o
pen and 1 closed port
Device type: general purpose
Running: Microsoft Windows 2000
OS CPE: cpe:/o:microsoft:windows_2000::sp4
OS details: Microsoft Windows 2000 SP4

OS detection performed. Please report any incorrect results at .

How can I loop in all the text and echo out all the XP machines? (Windows 2000)

Is there a better way to do this?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zequestionerAuthor Commented:

Per the above website i can use this:

#17: How do I detect remote operating system?

You can identify a remote host apps and OS using the -O option:

nmap -O
nmap -O  --osscan-guess
nmap -v -O --osscan-guess

Is there a better way to do this and have the script output a nice list?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.