Unfortunatelly, Path only accepts Directory or File paths not UNC paths.
Two possible options exists to solve this:
- map the path to a local drive .
- connect to the system exporting the share, and get the security descriptor
of shared directory/file path (use Win32_LogicalShareSecuritySetting
instead of Win32_LogicalFileSecuritySetting ).
Willy.
<ag*******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi all,
Willy kindly gave me this code recently but it doesn't work when I try
to use a UNC for fileObject. Has anyone ran into this issue?
string fileObject = @"c:\\temp"; // Watch the double Backslashes
using(ManagementObject lfs = new
ManagementObject(@"Win32_LogicalFileSecuritySettin g.Path=" + "'" +
fileObject + "'"))
{do some stuff...}