Solved

Checking the online status of a computer on a network

Posted on 1998-11-20
1
117 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now