Re: How to get the UNC share name of a given folder (if shared)?

From: Arild Bakken (arildb__at_hotmail.com)
Date: 08/16/04


Date: Mon, 16 Aug 2004 14:35:47 +0200

I guess you'll need to enumerate the shares on the computer and see if any
of them refer to the given path. Take a look at the Win32_Share WMI class
and the System.Management namespace.

Arild

"José Joye" <jose.joye@KILLTHESPAMSbluewin.ch> wrote in message
news:%23MoBdt4gEHA.216@tk2msftngp13.phx.gbl...
> Hello,
>
> Can someone could help me with the following:
>
> I have a directory (e.g.: C:\myTest) and I want to retrieve the UNC share
> name that has been assigned to it (or null if no share is defined for this
> particular directory).
>
> My first guess was to look at the DirectoryInfo Class. However, I could
> not
> find anything.
>
> Any help welcome!
> José
>
>



Relevant Pages