title: Creating a shared folder programmatically c#
body: <p>I am trying to create the shared folder in computer management shares with the following code</p>
  
  <pre><code>            ManagementClass managementClass = new ManagementClass("Win32_Share");
              ManagementBaseObject inParams = managementClass.GetMethodParameters("Create");
              ManagementBaseObject outParams;
              inParams["Description"] = Description;
              inParams["Name"] = ShareName;
              inParams["Path"] = FolderPath;
              inParams["Type"] = 0x0; // Disk Drive
              outParams = managementClass.InvokeMethod("Create", inParams, null);
              var res = (uint)(outParams.Properties["ReturnValue"].Value);
  </code></pre>
  
  <p>res always returns 2. </p>
  
  <p>Can anyone be of help in this regard?
  What does it 2 mean and what are all the other output parameters?</p>