AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile
Is there a way to tell if a file or folder exists on a server that is NOT mapped.? I am using this code and it works for a mapped drive: 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
I believe you can still use the \\hostname\sharedfoldername\ also. ____________________________ Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
The tests I have done show it does not work unless it is mapped.
if you have administrator privileges you'll be able to check if a folder exists by using the default administration shares (c$, d$,...)
I could be the \\ path works (without the $c, $d, etc) if you use the "FindFirstFile" api call instead... like: http://www.andreavb.com/forum/viewtopic.php?TopicID=1084&page=0#3345 just search the forum for the text in the ""'s if you want to see it. ____________________________ Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
Thanks to admin, his cods worked. Private Sub Command1_Click() MsgBox (Dir("\\yourserver\c$\winnt\regedit.exe")) End Sub I can do a dir of the folder and as long as there are files in it, I can detect it.