set objVoice = CreateObject("SAPI.SpVoice")
google_dns = "8.8.8.8"
function ping(arg)
  with CreateObject("WScript.Shell")
    ping = Not CBool(.run("ping -n 1 " & arg,0,true))
  end with
end function
 
if ping(google_dns) = true then
  objVoice.Speak ("Connected")
else
  objVoice.Speak ("Disconnected")
end if