Make my AppFolder shared in network

Fritz

Active member
Joined
Oct 6, 2002
Messages
40
Location
switzerland
Of course, I can just rightclick the folder in w-explorer and mark it as shared.

Now how could I do this from out of the app, maybe by using a checkbox, if activated the appfolder is put to be shared.

Or even better, if the shared-property could already be set at installation time, using dialog with controlboxes.

Have been searching around all over and found nothing related to this subject.
 
Meanwhile I found this:

Imports System.Management
...
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Dim Share_Info As String() = {"c:\MyApp", "MyApp", 0}
Dim Win_Shares As ManagementClass = New ManagementClass("Win32_Share")
Try
Win_Shares.InvokeMethod("Create", Share_Info)
Catch ex As System.Management.ManagementException
MessageBox.Show(ex.ToString)
Return
Finally
Win_Shares.Dispose()
End Try

MessageBox.Show(Share_Info(0) + " success!")

End Sub

This works fine, except on Win98 and Me, there it opens the share only in protected mode, i.e. readonly. Win98 also has to install the WMI component from the Windows CD.

Im searching now for some parameter to set the read/write property, which only exists in Win98/Me.

Is there anyone who has experience on that?

Fritz
 
Back
Top