Checking if a folder exists on a SAMAB Server using API Function

HI
I am using the filesystem function: FolderExists in VB 6 to determin if network share exists on a SAMAB Server : \\share
The FolderExists  function returns false, but the sahre exists (I can view it, copy to it, delete, etc... using Win explorer).
Is there a similar API function (With example) that I could use to check the samba share?

Thanks for your help
gfahd1Asked:
Who is Participating?
 
vinnyd79Commented:
Have you tried Dir

if Dir("\\servername\sharename",vbDirectory) <> "" Then
    Msgbox "Share Exists"
Else
   MsgBox "Share Does Not Exist"
End if
0
 
gfahd1Author Commented:
I did try Dir, but didn't work either.
It is not really a folder, I am checking the main root of the SAMBA share server to see if it is accessible.

Thanks
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
vinnyd79Commented:
Yes,but you must specify a servername as well as the sharename.
0
 
Richie_SimonettiIT OperationsCommented:
Vinnyd is absolutely right, you most specy server name AND share name
0
 
gfahd1Author Commented:
Hello,
Specifying a share name as well as a server name works fine. I thought there might be a way to check if the server exists, before I try to access the share. I might be wrong with my assumption.

Thanks
0
 
vinnyd79Commented:
You are wrong in assuming thay you can check the server in that manner.You can however check the server by pinging it assuming you are not blocking icmp packets.
0
 
Richie_SimonettiIT OperationsCommented:
But that's no problem, since you can access the sahre server exists, or am i wrong?
0
 
Richie_SimonettiIT OperationsCommented:
My previous comment wasn't for you, Vinnyd :)
0
 
gfahd1Author Commented:
Thanks All for your help,
Richie, NetServerEnum will do the trick.

Thanks Again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.