Windows – ms windows network activity bytes send and receive in command line

networkingwindows

In windows for example local area Connection Status popup window, there are some activity statistics that show network activity as bytes send and bytes received. I need to get this numbers periodically in cmd. Is there any way to get that? I tried netstat -e but numbers in both places definitely inrelated. it seems the results in gui is true but not in netstat -e

Best Answer

In Powershell:

$computer = "LocalHost"
$namespace = "root\CIMV2"
$Tcpip_NI = Get-WmiObject -class Win32_PerfRawData_Tcpip_NetworkInterface -computername $computer -namespace $namespace
$Tcpip_NI | Select BytesReceivedPersec,BytesSentPersec,BytesTotalPersec

In cmd line using just wmic:

wmic path Win32_PerfRawData_Tcpip_NetworkInterface Get BytesReceivedPersec,BytesSentPersec,BytesTotalPersec