Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the Vb.Net code for sharing a folder Programatically?
Posted

1 solution

 
Share this answer
 
v5
Comments
Sumit Bhargav 4-Dec-13 2:05am    
Thanks for the reply
the folder has the FullControl but its not shared
folder name - Right Click -select properties- Sharing tab-Advanced Sharing-Permissions-Read Only
while i want the full control and the Properties should also display it Shared.
Aydin Homay 4-Dec-13 2:14am    
Could you add you codes here ?
Sumit Bhargav 4-Dec-13 2:22am    
Dim managementClass As New ManagementClass("Win32_Share")
Dim inParams As ManagementBaseObject = managementClass.GetMethodParameters("Create")
inParams("Description") = "Resource Folder"
inParams("Name") = "folder name"
inParams("Path") = "path of folder"
inParams("Type") = &H0
AddFileSecurity("path of folder", "Everyone", "FullControl")
Dim outParams As ManagementBaseObject =managementClass.InvokeMethod("Create",inParams,Nothing)

This is my code and it just give a full control to folder but does not give any permission of sharing.
Member 14810877 2-May-20 2:54am    
AddFileSecurity ? Where is Imports From?
Aydin Homay 4-Dec-13 2:53am    
What is your windows operating ? if you are using Windows 7 it can`t work well ! check the try this link I added in the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900