-------------------------------------------------------------------------------------------------------------
x=ReportFileStatus("List.txt")
Function ReportFileStatus(filespec)
Dim fso, msg
Dim MyVar
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
Else
MyVar = MsgBox ("""List.txt"" not found!" &_
Chr (13) & "Make sure the list of computers is in the current directory" &_
Chr (13) & "" &_
Chr (13) & " Have a Nice Day :)", 016, "Ping Script") &_
WScript.Quit
End If
End Function
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "Computer Name"
objExcel.Cells(1, 2).Value = "Result"
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InputFile = fso.OpenTextFile("List.Txt")
Do While Not (InputFile.atEndOfStream)
HostName = InputFile.ReadLine
Set WshShell = WScript.CreateObject("WScript.Shell")
Ping = WshShell.Run("ping -n 1 " & HostName, 0, True)
objExcel.Cells(intRow, 1).Value = HostName
Select Case Ping
Case 0 objExcel.Cells(intRow, 2).Value = "On Line"
Case 1 objExcel.Cells(intRow, 2).Value = "Off Line"
End Select
intRow = intRow + 1
Loop
objExcel.Range("A1:B1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
wscript.echo "Ping Process as Terminated"
WScript.Quit
-------------------------------------------------------------------------------------------------------------
instead of excel, how can I have this result saved on txt (notepad)