Talk About Network

Google





Software > Basic Dos > How do I ... ?
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 622 of 700
Post > Topic >>

How do I ... ?

by "Gretch" <gretchen@[EMAIL PROTECTED] > Sep 26, 2007 at 10:39 PM

Although quite proficient at Unix shell scripting, I know very little about
the syntax of a DOS *.bat file, and would appreciate your help please.

The goal is to monitor a network connection, and if it fails, to dial a
named dialup Network Connection.

The idea that occurs to me is to check (using the Task scheduler) once per
minute whether Internet network continuity is intact, e.g.:

ping www.google.com

How do I tell in a batch file if that command was successful, or if it
failed? It would be simple in Unix, as all commands have a numerical exit
status that can be checked; a successful command has an exit status of 0
(zero):

ping -c1 www.google.com > /dev/null 2>&1; echo $?
0

ping -c1 wwww.google.com > /dev/null 2>&1; echo $?
1

How is such a thing accomplished in a batch file please? Does the ping
command issue an exit code that can be checked, or is there a different
method necessary?
 




 5 Posts in Topic:
How do I ... ?
"Gretch" <gr  2007-09-26 22:39:35 
Re: How do I ... ?
"Juan B. Rivera"  2007-09-27 01:58:57 
Re: How do I ... ?
<toml_12953@[EMAIL PRO  2007-09-27 03:49:09 
Re: How do I ... ?
"Jeff Belorit"   2007-12-05 15:13:55 
Re: How do I ... ?
"James Hamil" &  2008-01-29 11:24:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 19:43:54 PST 2009.