Solved

Checking the online status of a computer on a network

Posted on 1998-11-20
1
123 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month6 days, 10 hours left to enroll

634 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