How can I programmatically find the network path by which a folder has been shared?
There is no direct query. You'll have to infer it. The post How can I programmatically find the network path by which a folder has been shared? appeared first on The Old New Thing.

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.
The post How can I programmatically find the network path by which a folder has been shared? appeared first on The Old New Thing.