Ping by cmd in bat file

Asked

Viewed 3,590 times

1

TESTANDO PING POR ARQUIVO.bat

Whoa, does anyone know why this is happening? when I test p ping by cmd it works, but when I test for a.bat file it keeps consulting endlessly and hangs... someone can help me

  • Add how you’re passing the command to your bat file.

1 answer

1

Via file . bat, if you just pass ping [host], it will run infinitely even. You need to pass the parameter -n and the number of times you want to ping.

For example, the command below saved in a bat will "drip" google for 6 times and close:

ping -n 6 www.google.com

In the documentation there is a list of parameters if you want to increment the command.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.