Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know if someone is online on the same network using ICMP requests.

Being able to ping another workstation on the network to see if its currently on.

A batch file with if and then statements, if 100% packet loss then says user is unavailable. if ping was successful then user is available.

I'm not sure how to go about with this batch file.

share|improve this question

Like this:

setlocal EnableDelayedExpansion

set IP=...
for /f "delims=() tokens=2" %%a in ('ping %IP% ^| find "% loss"') do (
  set loss=%%a
  set loss=!loss:% loss=!
  if !loss! equ 100 (
    echo %IP% is unavailable
  ) else (
    echo %IP% is available

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.