Okay, here is the objective:
I want to be able to ping an external list of machines, and if the machines respond, I would like the machine name to be placed in another text file for a different vbs to reference.
Here is what I have so far:
THe above code has all sorts of errors . . . I am very, very new to this, and any help would be greatly appreciated.
[∞]MP
I want to be able to ping an external list of machines, and if the machines respond, I would like the machine name to be placed in another text file for a different vbs to reference.
Here is what I have so far:
Code:
strMonth = Month(Date)
strDay = Day(Date)
strYear = Right(Year(Date),2)
strFileName = "\\server2006\tech\log\pingresults.txt"
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InputFile = fso.OpenTextFile("systemlist.Txt")
Do While Not (InputFile.atEndOfStream)
HostName = InputFile.ReadLine
Set WshShell = WScript.CreateObject("WScript.Shell")
Ping = WshShell.Run("ping -n 1 " & HostName, 0, True)
Select Case Ping
Case 0 objfileName.writeline %machinename%
End Select
Loop
THe above code has all sorts of errors . . . I am very, very new to this, and any help would be greatly appreciated.
[∞]MP