@echo off
Title Tool Checking connection By Corporation ..
color 1f
rem : نجرب عن طريق فتح احد المواقع في البدايه اذا نجح الامر سينتقل الامر الى الاخير واظهار رساله ان الانترنت متصل
ECHO Checking connection, please wait...
PING -n 1 www.google.com|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESS
IF ERRORLEVEL 1 goto :TRYAGAIN
rem: في حال عدم فتح الموقع لأي سبب كان سنجرب مره اخـرى لعله يفلح ؟
:TRYAGAIN
ECHO FAILURE!
ECHO Let me try a bit more, please wait...
@echo off
PING -n 3 www.google.com|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESS2
IF ERRORLEVEL 1 goto :TRYIP
:TRYIP
rem: طبعاً اذا ما فلح امر فتح المواقع ننتقل الى الاي بي ادرس ممكن يكون في خلل بالمتصفح ! طيب نروح لأمر الاي بي
rem:طبعاً الاي بي وهمــي ..
ECHO FAILURE!
ECHO Checking DNS...
ECHO Lets try by IP address...
@echo off
ping -n 1 216.239.37.99|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESSDNS
IF ERRORLEVEL 1 goto :TRYROUTER
:TRYROUTER
rem:ايضاً في حال فشـل الاي بي ادرس ، نجـرب الرواترررررررر
ECHO FAILURE!
ECHO Lets try pinging the router....
ping -n 2 192.168.1.1|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :ROUTERSUCCESS
IF ERRORLEVEL 1 goto :NETDOWN
:ROUTERSUCCESS
ECHO It appears that you can reach the router, but internet is unreachable.
goto :FAILURE
rem: محاوله فاشله نتقل للامر الاخير اظهار رساله انه لا يوجد اتصال على الكمبيوتر
:NETDOWN
ECHO FAILURE!
ECHO It appears that you having network issues, the router cannot be reached.
goto :FAILURE
rem:ايضاُ محاوله فاشله وسينتقل للامر الاخير واظهار رساله بعدم وجود انترنت على الجهاز
:SUCCESSDNS
ECHO It appears that you are having DNS issues.
goto :FAILURE
rem:ايضاً نفس الشئ
:SUCCESS
ECHO You have an active Internet connection
pause
goto END
rem:هنا سيظهر رساله بانه يحوي اتصالاً على الجهاز
:SUCCESS2
ECHO You have an active internet connection but some packet loss was detected.
pause
goto :END
:FAILURE
ECHO You do not have an active Internet connection
pause
goto :END
:END