I fear this script will never work. I have a script that pushes a file to a list of workstations. i ping the workstation before i copy in order to keep the script from crashing. however, if the ping time out takes too long or expires in transit, the script locks up. it doesn't crash, it just sits there. Does anyone know how i can fix this? here is my code for the ping function:
response = ping(strComputerName)
intSuccess = instr(response," Received = 0")
'wscript.echo intSuccess
if intSuccess = 0 then
' Wscript.Echo "Connected " & strComputerName
blnSeverUp = true
else
blnServerUp = false
' Wscript.Echo "Not Connected " & strComputerName
end if
function ping(strTarget)
'cmdline="%COMSPEC% /c ping " & response
'wscript.Echo strTarget
cmdline="ping " & strTarget
Call ExternalCMDCall(cmdline,strOut)
ping=strOut
'wscript.echo ping
end function
Sub ExternalCMDCall(cmdline,strOut)
set objExCmd = objShell.Exec(cmdline)
strOut=objExCmd.StdOut.ReadAll
End Sub
response = ping(strComputerName)
intSuccess = instr(response," Received = 0")
'wscript.echo intSuccess
if intSuccess = 0 then
' Wscript.Echo "Connected " & strComputerName
blnSeverUp = true
else
blnServerUp = false
' Wscript.Echo "Not Connected " & strComputerName
end if
function ping(strTarget)
'cmdline="%COMSPEC% /c ping " & response
'wscript.Echo strTarget
cmdline="ping " & strTarget
Call ExternalCMDCall(cmdline,strOut)
ping=strOut
'wscript.echo ping
end function
Sub ExternalCMDCall(cmdline,strOut)
set objExCmd = objShell.Exec(cmdline)
strOut=objExCmd.StdOut.ReadAll
End Sub