Comprehensive guide on the use of the cacls.exe command line tool
You might have noticed that numerous command line tools are available on the Windows operating system, and learning about them is crucial. In a previous article, we talked about some of these tools like bcdboot.exe and bash.exe, but in this article, we will focus on another essential process known as cacls.exe.
What is cacls.exe?
Cacls.exe is an interactive command line tool used to display, modify or assign access control lists (ACLs) to files or folders. It helps determine who has access to a file or folder.
What does the Cacls command do?
Some basic functions of ACLs are listed below.
- This command line tool can add permission to a file or folder.
- It can be used to remove permissions to a file, allowing you to restrict access from other users.
- The Cacls.exe command line tool can be used to view the ACLs of a file or folder.
- This command line tool can also help replace the ACLs of a file or folder with a new ACL.
How to use cacls in cmd?
- Hold Windows + R to launch the Run dialogue, type cmd in the text field, then press Ctrl + Shift + Enter to open the command prompt in administrator mode.
- Once in the command prompt, input the code below to use the cacls command line tool. Replace file or folder with the name of the required file or folder.
cacls [file or folder] [options]
- There are many options you can choose from depending on what you want to do; some of them include:
/e: Edits the ACL of the specified file or folder
/g: Grants a permission to a user or group
/r: Removes a permission from a user or group
/d: Denies a permission to a user or group
/p: Replaces the ACL of the specified file or folder with a new ACL
- If you want to remove the Write permission from the Administrators group for a file, use the command below.
cacls C:\myfile.txt /r Administrators:W
What is the difference between icacls and Cacls?
Icacls and cacls are both command-line utilities. The main difference is that cacls is a legacy command no longer actively developed and supported by Microsoft.
Icacls, on the other hand, is the newer version that supports more features and provides additional functionalities.
This is as much as there is to know about the cacls.exe command line utility. If you have further questions, please tell us via the comment section below.