Skip to content

Instantly share code, notes, and snippets.

@digitalhuman
Created July 24, 2017 07:29
Show Gist options
  • Save digitalhuman/d54fac48339b3c2165e0aecab3eec43f to your computer and use it in GitHub Desktop.
Save digitalhuman/d54fac48339b3c2165e0aecab3eec43f to your computer and use it in GitHub Desktop.
0% package loss check in batch
@echo off
color 0A
ping -4 www.google.com -n 1 | find /I /N "0%% loss" > pingresult.txt
SET /P PingTest= < pingresult.txt
echo %PingTest%
(echo %PingTest% | findstr /i /c:"0%% loss" >nul) && (echo Variable contains the string "0%% loss") || (echo Variable does not have the string "0%% loss")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment