Batch netstat help

August 29, 2010 at 21:42:10
Specs: Multiple OS, -
we all know about netstat and how it shows all ports being used or listening to blah blah blah

I would like the IP addresses (the ppl who are connected to my computer) in a simple file.
Just the IP addresses EG

All i know is that a findstr and a For command are used together at once BUT... i cant seem to do it. this is what i have got so far.
@echo off & setLocal EnableDELAYedeXpansion
netstat /a > netstat.txt
for /f "tokens=* delims= " %%a in (netstat.txt) do (
type %%a | find /i "***.***.***.***" > nul

It does not get past the netstat info. I use windows 7 and when i go into cmd it works fine.
any help or imput will be helpful. or any improvements Thanks

See More: Batch netstat help

Report •

August 29, 2010 at 23:05:05
downloadGNU grep for windows. Its more useful than windows findstr/find

C:\test>netstat -an|grep -Po "(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"

GNU win32 packages | Gawk

Report •
Related Solutions

Ask Question