'Create a file to write the result
Dim objFile, strGuyFile, strFilePath
strFilePath = "ping_result.txt"
Set objFile = CreateObject("Scripting.
Set strGuyFile = objFile.CreateTextFile(
' Create shell object to run ping
Dim objShell, subnetID, range, result
subnetID = "192.168.37."
Set objShell = WScript.CreateObject("WScript.
For range = 2 to 254 ' the range of ip we want to test
Set objScriptExec = objShell.Exec("ping " & subnetID & range & " -n 1")
result = objScriptExec.StdOut.ReadAll
WScript.Sleep 500
strGuyFile.Write(result)
Next
strGuyFile.Close
No comments:
Post a Comment