+ Post New Thread
Results 1 to 6 of 6
Coding Thread, Shares and folder permissions in VB.NET in Coding and Web Development; I've got an old application (VB6) that creates user shares and sets NTFS permissions that has worked since Windows 2000. ...
  1. #1

    Join Date
    Mar 2007
    Posts
    427
    Thank Post
    16
    Thanked 16 Times in 10 Posts
    Rep Power
    19

    Shares and folder permissions in VB.NET

    I've got an old application (VB6) that creates user shares and sets NTFS permissions that has worked since Windows 2000.

    Now Server 2008/64bit has come along, and it won't work at all so it looks like a re-write. I'm using Visual Basic Express 2008 and so far can't see to find a simple way to do the following:

    - Create a folder on a local drive
    - Share the above folder (and set the share permissions)
    - Set the permissions for a folder within that share and set them to replicate downwards

    Has anyone got a code snippet or example they can show me? I'm going around circles here trying to find a way around this!

  2. #2

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,271
    Thank Post
    884
    Thanked 2,749 Times in 2,322 Posts
    Blog Entries
    11
    Rep Power
    785
    Localzuk made something similar without the sharing bit from the code of SetACL (opensource) and was good enough to post if for everyone here: Setting folder owners programatically

  3. #3

    Join Date
    Mar 2007
    Posts
    427
    Thank Post
    16
    Thanked 16 Times in 10 Posts
    Rep Power
    19
    Cheers for that - its a shame I can't register the ADsSecurity.dll on the Server 2008 box as that would save me a lot of time. This lets me set NTFS permissions quite easily

    Not sure why I can't register it - it works ok on Server 2003 and various other Windows variants.

  4. #4
    cromertech's Avatar
    Join Date
    Dec 2007
    Location
    Cromer by the coast
    Posts
    731
    Thank Post
    177
    Thanked 109 Times in 97 Posts
    Rep Power
    55
    Quote Originally Posted by GoldenWonder View Post
    its a shame I can't register the ADsSecurity.dll on the Server 2008 box as that would save me a lot of time.
    Very odd. I have this dll registered on my windows 7 machine thought it would work the same. I just put it into the syswow64 folder and did the usual regsvr32 command and it put it in for me. Only use it to create new year 7 accounts through a spreadsheet but makes it a doddle

  5. #5

    Join Date
    Mar 2007
    Posts
    427
    Thank Post
    16
    Thanked 16 Times in 10 Posts
    Rep Power
    19
    Sorry I wrote that wrong! I could register it,but it bombs out the program as soon as you try to create an object.

    I've had to go backwards and simply use Shell commands to use cacls , which works. Seems a shame to go back to DOS commands but ADsSecurity is from 2001 and theres no update!

  6. #6
    ANB
    ANB is offline

    Join Date
    Jan 2009
    Location
    Rotherham
    Posts
    14
    Thank Post
    0
    Thanked 8 Times in 1 Post
    Rep Power
    14
    It's probably too late but I have some free utilities which handle creating shares, setting permissions, and propagating them accordingly. I used to have them on my website at ANB Software Homepage but removed them when I merged them all together to make paid for applications. If you still need these then email me at adambent@anbsoftware.co.uk and I will email them over to you.

    Adam



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 3
    Last Post: 22nd April 2010, 11:13 AM
  2. Folder permissions?
    By TechSupp in forum Windows
    Replies: 1
    Last Post: 15th January 2010, 01:36 PM
  3. Folder Shares
    By tian in forum Windows
    Replies: 5
    Last Post: 9th June 2009, 12:51 PM
  4. Folder Permissions
    By wesleyw in forum Windows
    Replies: 6
    Last Post: 9th January 2007, 09:25 PM
  5. Home Folder Shares
    By Gatt in forum Windows
    Replies: 19
    Last Post: 30th May 2006, 05:37 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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