Login | |
|
 |
invalid procedure call or argument error - 6/27/2005 12:42:08 PM
|
|
 |
|
| |
marcusrp
Posts: 145
Score: 0
Joined: 4/19/2005
From:
Status: offline
|
Does anyone know why I would get an 'invalid procedure call or argument on row 5, char 1' with the following script? (its actually refering to the line >>>Set objFileName = objnoResponse.OpenTextFile("c:\compnames.txt", ForReading, 0)<<<, in case formatting on this forum messes up the code layout... I've used this exact line in other scripts, I don't know why it won't work here... Set objnoResponse = CreateObject("Scripting.FileSystemObject") Set Response = objnoResponse.CreateTextFile("c:\response.txt", ForAppending, True) Set noResponse = objnoResponse.CreateTextFile("c:\noresponse.txt", ForAppending, True) Set objFileName = objnoResponse.OpenTextFile("c:\compnames.txt", ForReading, 0) Do While objFileName.AtEndOfStream <> True strLine = objFileName.Readline Set objShell = CreateObject("WScript.Shell") Set objScriptExec = objShell.Exec( _ "ping -n 2 -w 1000 " & strLine) strPingResults = LCase(objScriptExec.StdOut.ReadAll) If InStr(strPingResults, "reply from") Then Response.WriteLine("Response!" & strLine) else noResponse.WriteLine("NO Response!" & strLine) end if Loop thanks!
|
|
| |
|
|
|
|
|