Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Directory Permissions in vb.net

Directory Permissions in vb.net

Scheduled Pinned Locked Moved Visual Basic
csharpsysadminhelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tasnim
    wrote on last edited by
    #1

    hi, Can anyone help me how to set directory permissions on a particular directory and also on the subdirectories and files within that directory. Basically I want to set specific permissions for a Windows Group. Only that group should be able to access that directory and have specific permissions like read, write, add,delete etc. What I did is I made a directory and assigned a particular group to it, i.e. only that group can access the directory on the basis of permissions. Then by using Scripting.FileSystemObject I copied that folder in another drive. But the permissions are not transferred. Even if the permissions are transferred it will be useful to me. Right now I tried on Windows Nt Server 4.0. But I want this to work on Windows 2000 also. Thanks. Tasnim

    J D 2 Replies Last reply
    0
    • T Tasnim

      hi, Can anyone help me how to set directory permissions on a particular directory and also on the subdirectories and files within that directory. Basically I want to set specific permissions for a Windows Group. Only that group should be able to access that directory and have specific permissions like read, write, add,delete etc. What I did is I made a directory and assigned a particular group to it, i.e. only that group can access the directory on the basis of permissions. Then by using Scripting.FileSystemObject I copied that folder in another drive. But the permissions are not transferred. Even if the permissions are transferred it will be useful to me. Right now I tried on Windows Nt Server 4.0. But I want this to work on Windows 2000 also. Thanks. Tasnim

      J Offline
      J Offline
      John Kuhn
      wrote on last edited by
      #2

      Copying files and directories is independent of setting permissions on files and directories -- except in the sense that you cannot do one without the other. The FileSystemObject, as far as I know, doesn't perform any actions with respect to permissions. In order to do anything with permissions, you'd have to declare and access the Windows NT/2000 security API's. I think Dan Appleman has an article on this subject, try www.desaware.com[^] or Amazon.

      1 Reply Last reply
      0
      • T Tasnim

        hi, Can anyone help me how to set directory permissions on a particular directory and also on the subdirectories and files within that directory. Basically I want to set specific permissions for a Windows Group. Only that group should be able to access that directory and have specific permissions like read, write, add,delete etc. What I did is I made a directory and assigned a particular group to it, i.e. only that group can access the directory on the basis of permissions. Then by using Scripting.FileSystemObject I copied that folder in another drive. But the permissions are not transferred. Even if the permissions are transferred it will be useful to me. Right now I tried on Windows Nt Server 4.0. But I want this to work on Windows 2000 also. Thanks. Tasnim

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Copying files using the FileSystemObject will not maintain the permission on the file. BTW: Permissions on the file level is not a good practice! What happened is the new copies of the file inherited the permission of the folder you copied the files to and the ownership of the file is set to the person that ran the script that copied the files. RageInTheMachine9532

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups