- How does one programmatically create a UNC share from a known directory?
- How does one revoke it programmatically?
I don’t want the user to fiddle with the Share dialog. Additional info such as changing the share name, comment, user limit is also welcomed.
Thanks
SoulBlade
(Using Delphi 7)
Create the share with NetShareAdd. This will share the directory with a null ACL, which is equavalent to allowing everyone full access.
Delete the share with NetShareDel.
Madshi‘s MadSecurity package has a helper which simplifies this down to: