Problem with batch file

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hello, I am trying to type the following two commands in a batch file but I
am having some difficulties.

tracert www.google.co.uk >> inetlog.txt
ping -n 20 www.google.co.uk >> inetlog.txt

The tracert command works fine and outpus to inetlog.txt
When the ping command tries to access inetlog.txt, a get the error message -
"The process cannot access the file because it is being used by another
process".
Also the batch keeps running forever instead of just terminating after the
two commands.

Please could someone help

Thanks
Mike
 
Hi Mike,

Have you tried outputting the 'ping' line to different file?

Using "exit" on a third line should stop it repeating itself.

Regards,
Capt.Crazy
 
Mike said:
Hello, I am trying to type the following two commands in a batch file but I
am having some difficulties.

tracert www.google.co.uk >> inetlog.txt
ping -n 20 www.google.co.uk >> inetlog.txt

The tracert command works fine and outpus to inetlog.txt
When the ping command tries to access inetlog.txt, a get the error message -
"The process cannot access the file because it is being used by another
process".
Also the batch keeps running forever instead of just terminating after the
two commands.

Hi

You haven't called your batch file tracert.bat or ping.bat by any chance?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top