Solved

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

Posted on 2003-10-24
10
234 Views
Last Modified: 2010-05-01
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
0
Comment
Question by:gfahd1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9616508
Have you tried Dir

if Dir("\\servername\sharename",vbDirectory) <> "" Then
    Msgbox "Share Exists"
Else
   MsgBox "Share Does Not Exist"
End if
0
 

Author Comment

by:gfahd1
ID: 9616643
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
 
LVL 28

Assisted Solution

by:vinnyd79
vinnyd79 earned 50 total points
ID: 9616785
Yes,but you must specify a servername as well as the sharename.
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9617578
Vinnyd is absolutely right, you most specy server name AND share name
0
 

Author Comment

by:gfahd1
ID: 9628551
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
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9628571
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9628609
But that's no problem, since you can access the sahre server exists, or am i wrong?
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 50 total points
ID: 9628628
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9628643
My previous comment wasn't for you, Vinnyd :)
0
 

Author Comment

by:gfahd1
ID: 9628754
Thanks All for your help,
Richie, NetServerEnum will do the trick.

Thanks Again
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question