Need to check if a dir is shared on the network

Need to check if a dir is shared on the network

Post by Kai Stempf » Wed, 20 Aug 2003 18:59:45


do you want to check that on the local system or on a remote system?
On the local system you can open the command prompt and enter "net share",
without the quotes ;)
you will see a list of the shared folders on your system.

However, I do not know how to find out if a folder is shared on a remote
system.
 
 
 

Need to check if a dir is shared on the network

Post by Mirza Nezi » Wed, 20 Aug 2003 19:40:24

Thanks Kai,

Yes I want to check it on the local machine.

I am looking for a procedure that uses windows NetShare APIs in checking if
a directory is shared on the network.

Regards,
Mirza N.

 
 
 

Need to check if a dir is shared on the network

Post by Arild Bakk » Wed, 20 Aug 2003 21:56:12

I guess it all depends on how you want to handle the result.

One thing to do is:

net share | find /I "c:\myfolder "

which will output one line of text if the folder is shared. If you want to
write an app to do it, then use the NetShareEnum and retrieve level 2
information and check the path on each shared folder.


Arild




if


share",


the
 
 
 

Need to check if a dir is shared on the network

Post by Mirza Nezi » Wed, 20 Aug 2003 23:33:09

Arild Thanks,

That is what I am going to do if there is no any other way which doesnt
require searching through the list of the shared dirs.

Regards,
Mirza N.









remote