Saturday, 12 September 2015

Windows trick to lock your folder using CACLS

CACLS command that apply the permission rules on folders.
Access Control Lists(ACL) only works on NTFS formatted drive,
ACL determines which users (or groups of users) can read or edit the file.


1. Open Notepad and type below command.

cacls folder_name /E /P everyone:n

eg. cacls test /E /P everyone:n

2. Save notepad file as "lock.bat".

3.Open another Notepad and type below command.

cacls folder_name /E /P everyone:f

eg. cacls test /E /P everyone:f

4. Save notepad file as "unlock.bat".

5. Now to lock your folder,double click lock.bat file.

6. And to unlock the folder,double click unlock.bat file.



More info about CACLS: http://ss64.com/nt/cacls.html

Grant access rights, permision can be:
          R  Read 
          W  Write
          C  Change (read/write) 
          F  Full control
          N  None

No comments:

Post a Comment