in reply to Detecting dial-up connections

Sure. You can execute the command 'ipconfig' and parse the output with the script. Another more kludgy way is if you do NOT have dial-on-demand set, you can ping a known address periodically and check the result.

But allow me to ask an exploratory question: Are you trying to determine if the link is down before you go off to a site, or are you attempting something else? Because it's Windows, there might be a better way to do it. If you can clarify what you're trying to do, we might be able to come with a more 'creative' solution.
  • Comment on (jcwren) Re: Detecting dial-up connections

Replies are listed 'Best First'.
RE: Re: Detecting dial-up connections
by Odud (Pilgrim) on Jun 10, 2000 at 00:02 UTC
    I'm trying to determine if the link is up and running before I try and retrieve something. The idea is that the script spends most of its time asleep and wakes up every x minutes. If it can see a connection it goes and gets something (actually some weather data from a local airport) otherwise it sleeps again.
      have you tried somthing like
      $minuits_to_wait = '5'; $last = my $last2 = 0; while (1) { if ((time - $last) > 60 * $minuits_to_wait ) { $ret = sometypeof-ping-routine(); if ($ret eq '1') { get_somthing(); } elsif ($ret eq '0') { print "Not connected\n"; } } sleep(60 * $minuits_to_wait); }