(view source code of nicspeed.kix as plain text)
If $Help <> "" Or InStr( "$PC", "/" ) > 0 Or InStr( "$PC", "?" ) > 0
$Ret = Syntax( )
EndIf
If $PC = ""
$PC = @WKSTA
EndIf
$objWMIService = GetObject( "winmgmts://" + $PC + "/root/WMI" )
If @ERROR
$Ret = ShowError( )
EndIf
$colItems = $objWMIService.ExecQuery( "SELECT * FROM MSNdis_EthernetCurrentAddress WHERE Active = True", "WQL", 48 )
For Each $objItem In $colItems
$strMsg = $strMsg + "Ethernet Adapter : " + $objItem.InstanceName + @CRLF
$col2Items = $objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed WHERE InstanceName = '" + $objItem.InstanceName + "'", "WQL", 48 )
For Each $obj2Item In $col2Items
$strMsg = $strMsg + "NDIS Link Speed : " + $obj2Item.NdisLinkSpeed + " kBps@CRLF"
Next
$strMsg = $strMsg + @CRLF
Next
? $strMsg
Function ShowError( )
? "Error # @ERROR"
?
$Ret = Syntax( )
EndFunction
Function Syntax( )
$strMsg = $strMsg + "@CRLFNICSpeed.kix, Version 1.00@CRLF"
$strMsg = $strMsg + "Display network adapter link speed for any WMI enabled computer on the network@CRLF@CRLF"
$strMsg = $strMsg + "Usage: KIX32 NICSPEED.KIX [ $$PC=computer_name ]@CRLF@CRLF"
$strMsg = $strMsg + "Where: " + Chr(34) + "computer_name" + Chr(34) + " is the optional name of a remote computer@CRLF"
$strMsg = $strMsg + " (default is the local computer name)@CRLF@CRLF"
$strMsg = $strMsg + "Written by Rob van der Woude@CRLF"
$strMsg = $strMsg + "http://www.robvanderwoude.com@CRLF@CRLF"
$strMsg = $strMsg + "Created with Microsoft's Scriptomatic tool@CRLF"
$strMsg = $strMsg + "http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/WMImatic.asp@CRLF"
? $strMsg
Quit(1)
EndFunction
page last modified: 2024-04-16; loaded in 0.0053 seconds