Batch Files - Using ping to test network connectivity

前端 未结 8 1044
名媛妹妹
名媛妹妹 2021-01-04 17:17

Using a batch file would it be possible to do something like:

ping google.com

if return success do ECHO You are connected to the internet

else return

8条回答
  •  伪装坚强ぢ
    2021-01-04 17:57

    You can use following snippet:

    @echo off
    Ping www.google.de -n 1 -w 1000
    if errorlevel 1 echo Not connected
    

提交回复
热议问题