Ping by cmd in bat file [closed]

1

Oops, does anyone know why this happens? When I try to ping the cmd it works, but when I test for a .bat file it keeps on querying without stopping, infinitely and crashes ... can anyone help me?

    
asked by anonymous 11.06.2017 / 00:19

1 answer

1

Via .bat file, if you just pass ping [host] , it will execute infinitely same. 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 "ping" google for 6 times and quit:

ping -n 6 www.google.com.br

In documentation there is a list of parameters, if you want increase the command.

    
11.06.2017 / 00:23