1.

Solve : Stuck!?

Answer»

Ok, I was wondering how to get the reply from this PING to be output to a text file:

for /f %%x in ('ping -n 1 xxx.xxx.xxx.xxx ^| find /i "reply from"') do (
if not errorlevel 1 iexplore.exe xxx.xxx.xxx.xxx
)

I want the string that is 'found' from 'find /i "reply from" to be output to a text document. Not too urgent but it's been ANNOYING me for a while. Oh and I could really do without the "if not errorlevel..." code if it has to be replaced (wasn't my code to BEGIN with, just got an idea from it) Thanks for the help!Apparently the original code was testing the availability of a remote computer before running IE.

Quote

Ok, I was wondering how to get the reply from this ping to be output to a text file

Try using redirection:

Code: [Select]ping -n 1 xxx.xxx.xxx.xxx > ping.txt

Code: [Select]ping -n 1 xxx.xxx.x.x | find /i "reply from" > ping.txt

Redirection can be a double edged sword. Some programs query the user for additonal information. The query can get buried in the redirected output. yup that got it! thanks!


Discussion

No Comment Found