473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Any way to tell if a machine in online?

Hi,

I have a script that I use to check to see if a machine is connected and
online. I am in the process of writing a new .net app that needs this same
kind of functionality. Is there any way to achieve this? This script uses
ping but if something else can provide the same kind of info that would be
great.

Echo %1
PING %1 -n 1 > PING.CHK
FIND /I "Pinging" PING.CHK
IF %ERRORLEVEL%== 1 GOTO HOSTNAME
FIND /I "Reply" PING.CHK
IF %ERRORLEVEL%== 1 GOTO OFFLINE
FIND /I "expired" PING.CHK
IF %ERRORLEVEL%== 1 GOTO DESTINATION
ECHO 4Error,ping expired in transit,%1 >> admreport.csv
goto Next1

:DESTINATION
FIND /I "Destination host unreachable" PING.CHK
IF %ERRORLEVEL%== 1 GoTo Start
ECHO 3Error,Destination host unreachable,%1 >> admreport.csv
GoTo Next1

:OFFLINE
ECHO 1Error,Host is off line,%1 >> admreport.csv
GoTo Next1

:HOSTNAME
ECHO 2ERROR,Host not found in DNS,%1 >> admreport.csv
GoTo Next1

:Start

Too bad I can't just use the Ping that is in V2.0. Any thoughts would be
greatly appreciated.

thanks in advance,
Bill
Nov 17 '05 #1
2 1589
You can re-write the codes in .NET or try turning your current codes
into COM and use InterOp.

Here is an example of the PING UTILITY and WEBSERVICE in C# .NET
http://www.eggheadcafe.com/articles/20020209.asp

SCDeveloper
http://www.sharingcorner.com

Nov 17 '05 #2
Thanks much SCDeveloper! I'll give it a whirl!

regards,
Bill
"SCDeveloper" wrote:
You can re-write the codes in .NET or try turning your current codes
into COM and use InterOp.

Here is an example of the PING UTILITY and WEBSERVICE in C# .NET
http://www.eggheadcafe.com/articles/20020209.asp

SCDeveloper
http://www.sharingcorner.com

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
9
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.