Linux and Unixish system comes with chmod and other commands to setup/change access permission from command line/shell.
However, when it comes to windows chmod is not available. Windows comes with a special command line utility called CACLS.
You can use it as follows:
CACLS files /e /p {USERNAME}:{PERMISSION}
Where,
- /p : Set new permission
- /e : Edit permission and kept old permission as it is i.e. edit ACL instead of replacing it.
- {USERNAME} : Name of user
- {PERMISSION} : Permission can be:
- R - Read
- W - Write
- C - Change (write)
- F - Full control
For example grant Rocky Full (F) control with following command (type at Windows command prompt):
C:> CACLS files /e /p rocky:f
Read complete help by typing following command:
C:> cacls /?
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 20 comments… read them below or add one }
You can use *.* in place of files to change access mode of multiple files at a time.
Super dude.. i got in a right time.. thanks for your contribution and sharing of knowledge..keep doing..
/T is a very nice switch in case of an entire drive’s permissions getting messed up. Recursion ftw?
Life saver! Just used this after having problems with explorer! worked a treat! Thanks!
This helped me get rid of a virus – there was a process that kept spawning an executable inside of AppData\Temp, so I ran:
cacls hki304.exe /D
/D for “deny access”, which stopped the process from being able to be started, and then the process that was spawning this revved up to 50% CPU. Gotcha ya bastard :)
Thanks for the tip!
thanks dude.you correct time tell the answer for me
regards
elango
Awesome, this was a life saver. I was working on a client’s PC and the host file got locked out somehow. It wasn’t visible, even while showing hidden files. I could open it through the command line but wouldn’t let me save it or edit it. Tried numerous things, scans, safemode, changing the attributes via command line, the whole nine yards. Only thing that worked was using this command.
“CACLS hosts /p administrator:f”
Then after that I was able to change the attributes and then edit the file back to normal. Thanks a ton OP
I tried it but, couldn’t get it done. Dont know why my command prompt accept the command I am using :(
Did you right click and run your command prompt as an administrator?
i went through your instructions as listed and the command line said this “No mapping between account names and security IDs was done” dont know what this means??
I need help because while trying to shutdown another computer in my home it is saying failed to find registry and i can’t figure how to add special permissions to my thing.
here what is the meaninig by files???
C:\Users\sudheesh\Videos>cacls filims /e /p sudheesh
syntax : > cacls — > is the keyword that does the job for you.
filims —> is the name of the folder needed to be deleted in my case .
/e —> stands for editing the permissions.
/p —> stands for creating a new permission .
sudheesh –> my username
processed dir: C:\Users\sudheesh\Videos\Filims
my permissions list got scrambled so i had to delete all permissions (stupid i know)
and now this is working but access denied
and i want to punch my laptop so hard :L
I was doing some work in my Digital forensics class and accidently set my admin permission to read only. when I use this method to try and set permission it doesnt seem to change anything. How do I get my admin right back to my admin without using admin obviously to set it. System still has full access obviously so I thought that command prompt would solve this issue.
Trying to recover data from a dead computer. Used Apricorn adapter to view IDE drive via usb connection. Am able to view and extract data from Administrative and All Users but not from user phbergh. I used the command CACLS PHBERGH /P PAUL:F and was able to cd to phbergh. I got access denied when trying to access My Documents for phbergh. I then used the command line CACLS *.* /T /P PAUL:F and after answering I was sure I received the access denied message. What am I doing wrong? Please help me.
Access is denied despite being signed in as admin? Any suggestions?
this works only for files in NTFS permission. How about for exFAT?
it does not worked for me. Access was denied while changing permission of a directory.
i have locked a folder in my computer by using cacls (folder name) /e /p everyone:n
but when i want to unlock this i have used CACLS files /e /p everyone:f
but i am unable to open this file
please help how i can unlock this folder