Results 1 to 14 of 14

Thread: Creating shared folders and specifying share permissions

Threaded View

  1. #2

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Creating shared folders and specifying share permissions

    Could not post the contents here as it is too long for the post size limit, so I've attached the 2 vb files to this post.

    See "Attached Files" section at the bottom of this post for my classes that make use of the NetShareAdd Windows API (and a couple of others) - just add them both to your project and then you can use my simple .NET wrapper as shown in the previous post Of course you can also just use them to see how the APIs are defined and used etc and make your own .NET versions.

    EDIT: New version of SharedFolder class uploaded that now allows you to create a share on a remote machine. There is now an optional argument for the SharedFolder.ShareExistingFolder method where you can specify the remote machine name - do not use "\\ServerName", just "ServerName" will do it.
    If you want to create the share locally then just either miss this argument off or specify Nothing for it.

    Here is an example of sharing the folder D:\Shared as "Shared Folder" on a remote server called TestServer:
    vb Code:
    1. SharedFolder.ShareExistingFolder("Shared Folder", "This is an example comment", "D:\Shared", PermissionsList, "TestServer")

    Note that I have included this functionality (along with a load of other Windows API based functions) in my Windows API library, which you can download for free here: http://cjwdev.wordpress.com/2010/07/...pack-released/
    Attached Files Attached Files
    Last edited by chris128; Jul 13th, 2010 at 05:24 PM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width