Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I have written a batch to ping Google (Internet Test) and then ping a server of ours (VPN Test) and the third thing I'd like to do is to check to see if a PDA is connected - Although I understand that this is a tough one so I've worked around it to be honest.
What I am now trying to do is to get my batch file to only proceed if the PINGS are sucessful, else the file should show an error of sorts, explaining which failed and what to do, then a pause and a loop to re-check connectivity after user interaction.
I have this so far:
-----------------------------------------------------------
@ECHO OFF
Title Service Check
Color F5
CD\
CLSEcho.
Echo.
Echo. Service check - Please read:
Echo.
Echo. Upon pressing Return, the following tests will
Echo. be initiated. Please be patient whilst these
Echo. checks complete:
Echo.
Echo. 1. Ping a Server (VPNE Conectivity Test)
Echo.
Echo. 2. Ping the Internet (Internet Conectivity Test)
Echo.
Echo. 3. Check Active sync (PDA Conectivity Test)
Echo.
Echo.
Echo.
Echo. Please note:
Echo.
Echo. This file will process information below and will
Echo. automatically conduct it's tests. Please do not close
Echo. the window or press any keys until prompted to do so.
Echo.
PauseRem Step 1:
Ping server.name.comRem Step 2:
Ping Google.co.ukRem Step 3:
START /W "C:\Program Files\Microsoft ActiveSync\WCESMgr.exe"
Pause
-----------------------------------------------------------I have no idea how to get the file to only proceed if the PING is okay.
Any ideas?

Or rather, how to get the file to throw an error if the PING is not returned.. I just realised how stupid that last comment sounded! lol.

Ping server.name.com | find "Reply"
if errorlevel 1 echo NG && goto :eof
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

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