topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday December 12, 2024, 12:33 pm
  • 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: wanted: CLI tool to determine if Internet access yes/no  (Read 8827 times)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
wanted: CLI tool to determine if Internet access yes/no
« on: April 25, 2006, 12:37 PM »
Hi,

I really could use such a small .exe, that maybe would just ping www.google.com and return the state so that I could use it in AutoHotkey. You know of anything?

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: wanted: CLI tool to determine if Internet access yes/no
« Reply #1 on: April 25, 2006, 01:08 PM »
I'm not sure, but i think this has already been done (not sure, but i think by me). Please check on coding snacks.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: wanted: CLI tool to determine if Internet access yes/no
« Reply #2 on: April 25, 2006, 01:14 PM »
I did a forum search (and just now another one) but didn't find anything...   :( Do you remember any key words?

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: wanted: CLI tool to determine if Internet access yes/no
« Reply #3 on: April 25, 2006, 01:47 PM »
Ok, now i remember i couldn't quite do this, but got some solutions (i think).
(btw: if you just want to know if the internet access is on or off on ahk, you could use the URLDownloadToFile command, and check what was it's errorlevel. In case the page couldn't be downloaded, the errorlevel will be different from 0.)

Here's the other thread i mentioned: https://www.donation...dex.php?topic=2999.0

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: wanted: CLI tool to determine if Internet access yes/no
« Reply #4 on: April 25, 2006, 01:55 PM »
(btw: if you just want to know if the internet access is on or off on ahk, you could use the URLDownloadToFile command, and check what was it's errorlevel. In case the page couldn't be downloaded, the errorlevel will be different from 0.)
Right, just trying to download http://www.google.com/index.html should work!  :up:

Cavalcader

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 194
  • Live Long & Prosper
    • View Profile
    • Donate to Member
Re: wanted: CLI tool to determine if Internet access yes/no
« Reply #5 on: April 25, 2006, 07:29 PM »
What about the ping command that comes with Windows?
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
            [-r count] [-s count] [[-j host-list] | [-k host-list]]
            [-w timeout] target_name

Options:
    -t             Ping the specified host until stopped.
                   To see statistics and continue - type Control-Break;
                   To stop - type Control-C.
    -a             Resolve addresses to hostnames.
    -n count       Number of echo requests to send.
    -l size        Send buffer size.
    -f             Set Don't Fragment flag in packet.
    -i TTL         Time To Live.
    -v TOS         Type Of Service.
    -r count       Record route for count hops.
    -s count       Timestamp for count hops.
    -j host-list   Loose source route along host-list.
    -k host-list   Strict source route along host-list.
    -w timeout     Timeout in milliseconds to wait for each reply.
My Linguistic Profile:
  40% General American English
  30% Yankee
  20% Dixie

What Kind of American English Do You Speak?

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: wanted: CLI tool to determine if Internet access yes/no
« Reply #6 on: April 26, 2006, 01:48 AM »
What about the ping command that comes with Windows?
Then I'd need to store the output and check it. I think it's just easier to use jgpaiva's idea.

Cavalcader

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 194
  • Live Long & Prosper
    • View Profile
    • Donate to Member
Re: wanted: CLI tool to determine if Internet access yes/no
« Reply #7 on: April 26, 2006, 03:17 PM »
Then I'd need to store the output and check it. I think it's just easier to use jgpaiva's idea.
Aha! After reading the linked thread I see better what you're after. I've used Pingometer with good success (it's mentioned in that thread). There's a related util called WWIP (Watch WAN IP) if you have a router. It'll basically pull an HTML page from it and look for a string that you specify. Great concept to stay current on a dynamic IP address without having to contact an external server, but I realize that's not exactly what you're looking for.
:)
My Linguistic Profile:
  40% General American English
  30% Yankee
  20% Dixie

What Kind of American English Do You Speak?