Hide Directory programmatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can i hide some directories in local comp .
i need that only admin can see them and their contents.
Thanks
 
Hi,

It's rather restricting access to these directories - I believe there is no
way (possibly except some 'hacking') to actually *hide* a directory - the
users will be able to see them but won't be able to access them.
This is done by manipulating the directory's Access Control List (ACL).
There is unmanaged API for editing ACLs, but I am less than sure managed
wrappers exist in the standard FCL (at least a quick look at the
System.Security namespace doesn't reveal anything looking like managed ACL
editing means).

So your question boils down to P/Invoking to the ACL management APIs - and
to good understanding of how ACLs work, and to this end I would strongly
recommend works of Jeffrey Richter.
 
Back
Top