Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NTFS Folder Permissions - Deny Access

Status
Not open for further replies.

Gaywrath

Programmer
Mar 5, 2009
2
GB
I have a project where user permissions need to be granted to a folder allowing read only rights. I have used the code in thread: thread222-644287 with great success.

The problem I have now is that I also need permissions to be removed once the user has finished reviewing the contents of the folder.

I have tried replacing this declaration in the subroutine SetAccess:
Dim sCurrentACE As ACCESS_ALLOWED_ACE

with:
Dim sCurrentACE As ACCESS_DENIED_ACE

where both ACCESS_ALLOWED_ACE and ACCESS_DENIED_ACE are Types defined earlier in the code.

The result of this has been that the users permissions have remained the same. I then manually removed the user from the permissions list and ran it again and it actually added them back in. ARRGGHH!

I really am not at all at home with API functions and short of what I have attempted here I am stumped. I can't find any example on the net other than the code listed in the thread: thread222-644287 (although this example does appear all over the net)

Has anyone here attempted this before or know how it can be achieved?

Many thanks in advance.

Namaste

G




 
I need to understand what yoiu are trying to achieve here.

For that code to work you have to be a member of the Administrators group. And members of the Administrators group generally have got access to most files and folders anyway ...
 
strongm, thanks for the response.

The person who will be running the code is an administrator for the folder and they are granting access for other users. This has been tested and all works fine.

My next goal is that the folder admiministrator can then remove these permissions once the other user has finished reviewing the files contained within the folder. I just don't understand how to adapt the code to do this.

This is all in an attempt to automate an existing manual process.

I hope this clarifies what I am trying to achieve.

Many thanks again
 
Coincidence or not, I am in the midst of something similar:



I am preparing to primarily work from home. Part of this is / was to clear out a lot of old folders & files. I have made archives of all of the ones I want to remove. Alas, when I try to delete these, many (actually most) cannot be deleted. I have wended my way through much of the morass, and end up at:



Folder -> Properties-> Permissions-> Security



Only to find I do not have full access rights to them. I have tried switching to the only other user on the system with admin rights, but cannot seem to change the permissions.



Can you point out any other approaches / solutions?


Michael Red


MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top