Visual Basic 2008 share a folder

JD2369

Member
Joined
Jan 12, 2011
Messages
19
Programming Experience
Beginner
I have the code to create a folder, does anyone have the code to share the folder and set the permission for everyone to have full control?

Thank You
 
VB.NET:
Dim info As New ProcessStartInfo("net", "share test=d:\testshare /grant:everyone,full")
With info
    .RedirectStandardOutput = True
    .UseShellExecute = False
    .CreateNoWindow = True
End With
Dim proc As Process = Process.Start(info)
Me.ResultTextBox.Text = proc.StandardOutput.ReadToEnd
proc.Dispose()
 
I'd use the FolderBrowserDialog (add to form from Toolbox). Doubleclick the Button in designer to get to the Click event handler and write your code there. You'd call the dialog.ShowDialog and retrieve the SelectedPath property value and use that as input to the String expression. Give it a go.
 
Back
Top