Directory Permissions in vb.net
-
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
-
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
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.
-
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
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