Read Names From File

‘Create a FileSystemObject
Set oFS = _
CreateObject(“Scripting.FileSystemObject”)
‘Open a text file of computer names
‘with one computer name per line
Set oTS = oFS.OpenTextFile(“c:\computers.txt”)
Set oTSOut = oFS.CreateTextFile(“c:\errors.txt”)
‘go through the text file
Do Until oTS.AtEndOfStream
‘get next computer
sComputer = oTS.ReadLine
On Error Resume Next
‘***MAKE CONNECTION***
If Err <> 0 Then
oTSOut.WriteLine “Error on ” & sComputer & _
“:” & Err.Number & “, ” & Err.Description
Else
On Error Goto 0
‘***REST OF CODE HERE
End If
Loop
oTS.Close
oTSOut.Close

email me