
26.11.2008, 22:16
|
|
Динозавр
Регистрация: 10.01.2008
Сообщений: 2,841
Провел на форуме: 9220514
Репутация:
3338
|
|
Что-то в это роде, скопируй в блокнот и сохрани как speed.vbs
Код:
On Error Resume Next
FileDestination = "c:\result.txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Destination = FSO.CreateTextFile(FileDestination)
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
set WshShell = WScript.CreateObject("WScript.Shell")
arrComputers = Array(WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%"))
For Each strComputer In arrComputers
Str = "=========================================="
Destination.WriteLine Str
Str = strComputer
Destination.WriteLine Str
Str = "=========================================="
Destination.WriteLine Str
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PerfRawData_Tcpip_NetworkInterface", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
if objItem.CurrentBandwidth = 10000000 then
Str = ""
else
Str = "Скорость подключения:" & objItem.CurrentBandwidth
Destination.WriteLine Str
end if
Next
Next
Set FSO = Nothing
Set Destination = Nothing
Set objWMIService = Nothing
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\result.txt", 1, true
Set WshShell = Nothing
WScript.Quit
Последний раз редактировалось Pashkela; 26.11.2008 в 22:19..
|
|
|