Solved

Checking the online status of a computer on a network

Posted on 1998-11-20
1
122 Views
Last Modified: 2010-05-03
Is there a way to use VB to tell whether or not a computer is on the network?? any code will be helpful. Will start at 50 will give more for a more thorough answer.  thanks!
0
Comment
Question by:gwaltersii
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
jf26028 earned 50 total points
ID: 1445983
You can use ping to tell if the computer is on the network.  It is not exactly vbcode, but it works.  Just do the following:

dim tempstring as string
dim computername as string   'has the name of the computer you
                             'to identify on the network

open "temp.bat" for output as #1
print #1, "ping " & computername & " > temp.tmp"
close #1
shell("command.com /c temp.bat", vbhidden)
open "temp.tmp" for input as #1
line input #1, tempstring
line input #1, tempstring
line input #1, tempstring
close #1

if instr(tempstring, "Request timed out.") then
   msgbox "computer not found",,"error"
else
   msgbox "computer found",,"found"
end if



this is rough code, you can parse the file different ways and clean up this code, but it should work.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

729 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