|
lists = "SERVER;PENYAN;Caiwu;andysky"
aMachines = split(lists,";")
For Each machine in aMachines
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select * from Win32_PingStatus where address = '"& machine & "'")
For Each objStatus in objPing
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then ss = ss &vbcr& machine
Next
Next
WScript.Echo("以下计算机PING不通:" & ss )
其中lists = "SERVER;ENYAN;LIU-XIELI;andysky"表示四台电脑的名字,你可以将你的局域网中所有电脑名输入进去,执行后将罗列出所有PING不通的电脑名字
[ 本帖最后由 andysky 于 2009-8-14 16:50 编辑 ] |
|