Batch File: Hide Ping test results

batchcommand lineping

I'm making a batch file that tests a Computer name and sees if it responds.

However when I run it, even with the "@echo off", I still see the reply being sent and so on. How can I hide that?

Best Answer

redirect the output to nul:

ping -n 1 %computer_name%  | find "Reply" > nul

this will still correctly set the %errorlevel% if the string was or was not found, but also hide the output.

Related Question