[Batch]利用ping確認網路是否有通
batch file code:
@ECHO OFF Ping 168.95.1.1 -n 1 -w 1000 > nul SET CHK_NET_STATUS=N if errorlevel 1 ( echo Not connected SET CHK_NET_STATUS=N ) else ( echo success SET CHK_NET_STATUS=Y ) echo %CHK_NET_STATUS% pause
reference web:
http://stackoverflow.com/questions/6357515/batch-files-using-ping-to-test-network-connectivity
留言
張貼留言