Try Dim managementClass As New ManagementClass("Win32_Share") Dim inParams As ManagementBaseObject = managementClass.GetMethodParameters("Create") inParams("Description") = "My Description" inParams("Name") = "My Folder" inParams("Path") = "C:\My Folder" inParams("Type") = &H0 Dim outParams As ManagementBaseObject = managementClass.InvokeMethod("Create", inParams, Nothing) If Convert.ToUInt32(outParams.Properties("ReturnValue").Value) <> 0 Then MessageBox.Show("Unable to share directory.") Else MessageBox.Show("Shared folder successfully!") End If Catch ex As Exception MessageBox.Show(ex.Message) End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)