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 /?
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins

- My 10 UNIX Command Line Mistakes
- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
Facebook it - Tweet it - Print it -
We're here to help you make the most of sysadmin work. So, subscribe!

{ 13 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???
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