refresh windows network performance counters in command line
- by michalv82
I am testing a USB device connected to a windows PC. When the device is connected then windows has another network interface going through the device. I need to get the bytes transffered for that specific interface, basically I need the data shown in the networking tab in the task manager for my interface adapter. I found this question which helped to get this info: ms windows network activity bytes send and receive in command line
However I have a problem when I run multiple tests - each time I disconnect and connect the device there's another line for the interface, like below. In the task manager networking tab I only see one record for my interface but I don't know how I can know from command line which is the lastest and current instance (it's not like the first line or last line is always the current interface, I noticed it's not consistent):
wmic path Win32_PerfRawData_Tcpip_NetworkInterface Get Name,PacketsReceivedPerSec,PacketsSentPerSec,BytesReceivedPersec,BytesSentPersec
BytesReceivedPersec BytesSentPersec Name PacketsReceivedPersec PacketsSentPersec
422666370 6317989292 Intel[R] 82579LM Gigabit Network Connection 2715169 8109643
49150 375973 My USB Device 432 568
0 0 My USB Device _2 0 0
0 0 My USB Device _3 0 0
0 0 My USB Device _6 0 0
0 0 Local Area Connection* 9 0 0