Advertisement
mvineetmenon

Autoshutdown in no internet connectivity DOS bat

Mar 31st, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.37 KB | None | 0 0
  1. @echo off
  2.  
  3. :START
  4.  
  5. ECHO Checking connection, please wait...
  6. ::Check for connectivity using PING test.
  7. PING -n 1 www.google.com|find "Reply from " >NUL
  8. IF     ERRORLEVEL 1 goto :FAILURE
  9. TIMEOUT 900                    
  10. :: If PING successful, then loop.
  11. GOTO :START
  12.  
  13. ::If PING fails, then shutdown after giving the reason.
  14. :FAILURE
  15. echo " Net Gone!! Shutting Down PC!"
  16. SHUTDOWN /s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement