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"
else
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?