|| first or second -----> Do second if first fails
&& first and second --> Do second only if first succeeds
This is a one liner that I came up with to ping a whole subnet. Very quick and dirty so not as nice as it should be:
for /%g in (1,1,254) do @ping 192.168.20.%g 2>&1 > nul && echo Alive 192.168.20.%g || echo Dead 192.168.20.%g
Remember for statements on the command line only use one %G when dereferencing the variable that is iterated. In a batch file or command script, you must use two percent signs, .i.e., %%G.
ok hi there i think i figered out how to do it
but it's a litle dificult and i need to look up
some codes but heres the trick:
you make a file of a succesfull ping
wich show howmany paackarived at adres sucesfull there should be 4 if
not mistaken
now u save this in a filed colled "good.txt"
then u u make a batch file with a ping that saves it to a txt file called "ping.txt"
and call this .bat file "ping.bat"
then u make a last and finall .bat called "your desired name here.bat" and let the script
call ping.bat
and compare ping.txt with good.txt
if there the same let it display succes
if it is falls let it display failure
this is yust in short but i'll work out the code and explain it in a tuturial here if u guys would like that
Last edited by hwit; Jun 4th, 2007 at 8:00 pm. Reason: bad gramer needed corections and i wasent clear on one part
ok hi there i think i figered out how to do it
but it's a litle dificult and i need to look up
some codes but heres the trick:
you make a file of a succesfull ping
wich show howmany paackarived at adres sucesfull there should be 4 if
not mistaken
now u save this in a filed colled "good.txt"
then u u make a batch file with a ping that saves it to a txt file called "ping.txt"
and call this .bat file "ping.bat"
then u make a last and finall .bat called "your desired name here.bat" and let the script
call ping.bat
and compare ping.txt with good.txt
if there the same let it display succes
if it is falls let it display failure
this is yust in short but i'll work out the code and explain it in a tuturial here if u guys would like that
Pardon me - this is exactly what is in my post 22 days ago
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Previous Thread in Legacy and Other Languages Forum Timeline:Euphoria
Next Thread in Legacy and Other Languages Forum Timeline:Lisp question