Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 03, 2016, 03:38:50 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Configurable batch code to launch a web after check internet connection  (Read 682 times)

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Configurable batch code to launch a web after check internet connection

My idea is schedule this bat file able to launche a website or any similar task after checking the internet conection.
If not active internet connection keep trying until success.

Best Regards
 :-*

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,471
    • View Profile
    • Donate to Member
Code: Text [Select]
  1. rem Check Internet connection, if not found loops every 30 seconds
  2. rem Adapted from:
  3. rem http://stackoverflow.com/questions/6357515/batch-files-using-ping-to-test-network-connectivity
  4. @echo off
  5. set site=www.google.com
  6. :loop
  7. ping www.google.com -n 1 -w 5000 > nul
  8. if errorlevel 1 (
  9.   ping -n 30 127.0.0.1 > nul
  10.   goto loop
  11.   )
  12. elseif (
  13.   start http://%site%
  14.   )

FYI

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Wonderful
Thanks a lot

Best Regards