set security on folder/file programmatically

  • Thread starter Thread starter Grei
  • Start date Start date
G

Grei

I need to set folder security to full control to everyone
is it possible from code?
example would be nice.

Thanx
 
Grei said:
I need to set folder security to full control to everyone
is it possible from code?
example would be nice.

Thanx

The easiest is to use Process.Start to invoke the command line tool
cacls.exe.
The following adds everyone with Full access rights to the ACL of
"FolderName".
cacls FolderName /E /G everyone:F

Check MSDN for a Process.Start sample, run cacls /? to get a list of
options.

Willy.
 
Back
Top