SoFunction
Updated on 2025-04-13

A vbs script that views LAN online IP


strSubNet = "192.168.1."
Set objFSO= CreateObject("")
Set objTS = ("e:\")

For i = 1 To 254
strComputer = strSubNet & i
blnResult = Ping(strComputer)
If blnResult = True Then
"Ping " & strComputer & " success!"
End If
Next


"Done!"

Function Ping(strComputer)
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = ("Select * From Win32_PingStatus Where Address='" & strComputer & "'")
For Each objItem In colItems
Select case
Case 0
Ping = True
Case Else
Ping = False
End select
Exit For
Next
End Function