bat script to check if a network PC is turned on?

Posted on 2013-06-14
Medium Priority
Last Modified: 2013-06-14
Is there a bat script that will check whether a pc on a network is turned on, or logged in, and perform other bat operations if it is on?
Question by:machine_run
  • 2
LVL 12

Accepted Solution

Sam Simon Nasser earned 1332 total points
ID: 39248981
I'll give you a hint:
in the bat file, run ping command; if it return results, then the PC is on, otherwise it's off.
to check if is logged in, check the script in this page and modify it to your needs
LVL 12

Assisted Solution

by:Sam Simon Nasser
Sam Simon Nasser earned 1332 total points
ID: 39248986
also this is .vbs script to check logged users, if may help

Assisted Solution

dec0mpile earned 668 total points
ID: 39248989
That would look like this (replace the IP in this example with machine you want to check):

@echo off

rem Check to see if machine is on.
ping -n 2 >NUL 2>NUL

if errorlevel 1 goto down

rem ##########################
rem Insert the code for doing work when the machine is on between this line and 'goto end" line
goto end

  rem The machine down
  echo It's not on


Open in new window


Author Closing Comment

ID: 39249001

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question