wsh / vbs simple query read

Soldato
Joined
17 Jul 2008
Posts
7,392
I jsut want it to execute the "objShell.Run("ping " & strContents)" one at a time currently if there are 50 servers in the list it will ping all 50 at the same time (ie open 50 shells at once) (eventually it will not be a ping it will be a batch file that writes to a log file so they have to run one after another)

Dim objResult
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("test.txt", 1)
Set objShell = WScript.CreateObject("WScript.Shell")
Do Until objFile.AtEndOfStream
strContents = objFile.Readline
objResult = objShell.Run("ping " & strContents)
Loop
objFile.Close
 
Back
Top Bottom