devxlogo

Add Share for a special User group in VB

Question:
How can I add a Share in Visual Basic to a Local or Remote Machine with permission only for a special User group?

Answer:
That is a rather difficult question. You can use the code I’ve already posted to add a share, but you will need to use Level = 502 (SHARE_INFO_502) instead of Level = 2. That’s the easy part. The hard part is that you must construct a Security Descriptor (SD) as part of the information you pass, and that is hard. For more information on how to deal with SDs from Visual Basic, see the Microsoft Knowledge Base article, “HowTo: Add an Access-Allowed ACE to a File Through Visual Basic” (Q194757).

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Five Early Architecture Decisions That Quietly Get Expensive

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.