Solved

Checking the online status of a computer on a network

Posted on 1998-11-20
1
120 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
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 59
Sending a email via excel using vba 6 97
SLMGR Switches Are Not Working On KMS Host 3 109
VB6 - Convert HH:MM into Decimal 8 62
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

809 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