Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 143
  • Last Modified:

What is the better way to know if the program has access to another computer in the local network

I am doing a program (Visual Basic 6) that access to another computer in the local network, so I need to make a function that tells me if the computer is accessible. Only this, if it is accessible.

I have the name (not the IP) of the computer to test if I have access, and perhaps the computer running the program has no access to a DNS server (for example, a laptop that it is not at the office). Both computers, the one which is running the program and the one that must be accessed, belong to a Windows Domain in a Windows 2000 or Windows 2003 environment).

The question is that this function must answer as fast as possible.

Essentially, I need to know if the destination computer has a SQL Server and if it is sharing a -specific- directory.
  • 2
1 Solution
gllanderasAuthor Commented:
Thanks, hes, but I'm looking for something faster.

I wonder if is possible to do using WMI. I did a experiment with this code (vbscript):

On Error Resume Next

strConnection = "winmgmts:\\comp1"

Set objWMIService = GetObject(strConnection)
lngError = Err.Number
Set objWMIService = Nothing

If lngError = 0 Then
  MsgBox "OK."
  MsgBox "NOK:" & CStr(lngError)
End If

But this seems to work only if the user is a member of the administrative group of the domain.
gllanderasAuthor Commented:
hes, thanks for your help.

I assume that the only way to do this is sending a ping to the computer with the code posted in that link.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now