topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Friday March 29, 2024, 1:52 am
  • Proudly celebrating 15+ 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 2276 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • 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: 5,641
    • 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

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Wonderful
Thanks a lot

Best Regards