Getting the status of an Network Interface (WMIC)

Viewed 49

I've been researching this for about 2 hours now and and I have the basic cmd:

wmic path Win32_PerfRawData_Tcpip_NetworkInterface Get BytesReceivedPersec,BytesSentPersec,BytesTotalPersec

I don't want the bytes for all of my network interfaces.

I want to get the total bytes for a certain interface, does anybody know how to do this because I cannot find anything on here or the web.

1 Answers

I don't if this what you want to get or not ?


@echo off
Title Get TotalBytes
@for /f "skip=2 tokens=2 delims=," %%a in (
'wmic path Win32_PerfRawData_Tcpip_NetworkInterface Get BytesTotalPersec /format:csv'
) do (Set "TotalBytes=%%a")
echo TotalBytes = %TotalBytes%
pause
Related