日期:2014-05-17 浏览次数:20817 次
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetworkInterface = objWMIService.ExecQuery("Select * from Win32_PerfFormattedData_Tcpip_NetworkInterface") For Each objNetworkInterface in colNetworkInterface wscript.echo objNetworkInterface.Name wscript.echo "============================================" wscript.echo "CurrentBandwidth: "&objNetworkInterface.CurrentBandwidth/1000&" KB" wscript.echo "UsedBandwidth: "&objNetworkInterface.BytesTotalPersec/1000&" KB" wscript.echo "UsedPercent: "&objNetworkInterface.BytesTotalPersec*100/objNetworkInterface.CurrentBandwidth&" %" wscript.echo "PacketsSent: "&objNetworkInterface.PacketsSentPersec&"/sec" wscript.echo "PacketReceived: "&objNetworkInterface.PacketsReceivedPersec&"/sec" wscript.echo "============================================" Next
------解决方案--------------------
ls
怎么操作呢... 保存成bat 运行得不到想要的信息啊
007 哪呢?????大侠
------解决方案--------------------
@echo off for /f "skip=2 tokens=2-6 delims=," %%i in ('"wmic path Win32_PerfFormattedData_Tcpip_NetworkInterface get Name,CurrentBandwidth,BytesTotalPersec,PacketsReceivedPersec,PacketsSentPersec /format:csv"') do ( echo Network Interface: %%k setlocal EnableDelayedExpansion set /a _j=%%j/1000 & echo CurrentBandwidth: !_j! KB set /a _i=%%i/1000 & echo BytesTotalPersec: !_i! KB set /a _d=%%i*100/%%j & echo Usage: !_d! Percent endlocal echo PacketsReceivedPersec: %%l echo PacketsSentPersec: %%m )
------解决方案--------------------
我本人会,但是学习了啊!