When you right-click a folder in Explorer, select Properties, and go to the Sharing tab, there is a section titled “Network File and Folder Sharing”, and in there, it tells you the network path by which this folder has been shared. (Or “Not shared” if it hasn’t been shared at all.) How can I obtain this path programmatically?
There is no one-stop-shop function for doing this. The property sheet calculates it on the fly.
What you can do is call NetShareEnum
to enumerate all the shared folders (looks like level 2 gives you paths), and then look for one that is equal to or is a parent of the folder in question.
Note that there may be multiple matches. The “Network File and Folder Sharing” page shows what it thinks is the best match.
0 comments
Be the first to start the discussion.