468,544 Members | 1,858 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

Finding out if a computer is connected to the network

Iv developed a small program that looks for a file over our network, and copy it to the location of another computer. Im using the "If FileExists("\\oldpc\main share\Folder\file.txt") Then" way of finding if the file exists, but i want to make it so that it tries to look for the computer, not the file. At the moment this is how i am finding and copying the file:

If FileExists("\\oldpc\main share\Folder\file.txt") Then
FileCopy "\\oldpc\main share\Folder\file.txt", "C:\Documents and Settings\All Users\Desktop\back ups\file.txt"
msgbox "Error"
end if

Public Function FileExists(Fname As String) As Boolean

If Fname = "" Or Right(Fname, 1) = "\" Then
FileExists = False: Exit Function
End If

FileExists = (Dir(Fname) <> "")

End Function

Instead of finding the file, i want it to find the PC, because, although the PC is connected, the file might not be at the location specified so it errors, and i want TWO different error messages. 1 saying the file is not at location, and 1 saying the computer is unable to be located. Can anyone help?
Sep 15 '06 #1
0 1686

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

14 posts views Thread by Mickel Grönroos | last post: by
23 posts views Thread by anton.vredegoor | last post: by
7 posts views Thread by Jason Reichenbach | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.