using System.Management;
....
int ret = DeleteShare(someshare);
....
static int DeleteShare(string shareName)
{
using (ManagementObject o = new ManagementObject("root\\cimv2",
"Win32_Share.Name='" + shareName +"'", null))
{
ManagementBaseObject outParams = o.InvokeMethod("delete", null, null);
return (int)(uint)(outParams.Properties["ReturnValue"].Value);
}
}
Willy.
"pnp" <pnp.@.softlab.ntua.gr> wrote in message
news:eD****************@TK2MSFTNGP15.phx.gbl...
Hi all,
How can I remove a specific folder share from a folder, through C# code?
Thanks in advance,
pnp