Computing.Net > Forums > Programming > Batch file to ping and email.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file to ping and email.

Reply to Message Icon

Name: JrMaster
Date: September 23, 2008 at 13:05:35 Pacific
OS: Vista/2008
CPU/Ram: 4GB
Product: Dell
Comment:

Hi,

I'm trying to write a script that will ping a number of machines, If there's a reply continue to the next machine if not email me with alert.
I'm in a domain and need to send the mail through Exchange server 2007.
I need it to be fully automated.
After a week of searching i couldn't find any answer that worked for me.

Any help will be much appreciated...
TIA,

JrMaster.




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 24, 2008 at 03:51:12 Pacific
Reply:

I dunno Exchange server 2007; hopefully you do and just need to script it. Get your PC names into a file, like PClist.

=========================================
@echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in (PClist) do (
ping %%a | find "Reply" > nul
if errorlevel 1 echo here's where you get notified
)


=====================================
If at first you don't succeed, you're about average.

M2


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file to ping and email.

Batch file to start and stop servic www.computing.net/answers/programming/batch-file-to-start-and-stop-servic/15882.html

Batch File to open and move .ttf fi www.computing.net/answers/programming/batch-file-to-open-and-move-ttf-fi/12043.html

Batch File to Parse and Write back www.computing.net/answers/programming/batch-file-to-parse-and-write-back/18101.html