Windows – how to grant access to a folder using cacls

caclscommand lineSecuritywindows xp

I have revoked a permission for a folder test using cacls.

cacls d:/test /D adsd14

Now I trying to reassign permission to this folder using the same command.

cacls d:/test /E /G adsd14:F

It says processed dir: d:/test

But still, I cant access the folder.


Best Answer

  • The first step is to take ownership of the files.
    Start a Command Prompt box (cmd) as administrator, and enter:

    takeown /f /r d:\test
    cacls d:\test /t /e /c /g username:F

    If takeown is not found, then while logged-in as Administrator, launch Explorer and do the following:

    1. Right-click the folder that you want to take ownership of, and then click Properties.
    2. Click the Security tab, and then click OK on the Security message (if one appears).
    3. Click Advanced, and then click the Owner tab.
    4. In the Name list, click your user name, or click Administrator if you are logged in as Administrator, or click the Administrators group. If you want to take ownership of the contents of the folder, select the Replace owner on subcontainers and objects check box.
    5. Click OK, and then click Yes when you receive the following message:
      You do not have permission to read the contents of directory folder name. Do you want to replace the directory permissions with permissions granting you Full Control?
      All permissions will be replaced if you click Yes.
      Note: folder name is the name of the folder that you want to take ownership of.
    6. Click OK, and then reapply the permissions and security settings that you want for the folder and its contents.


  • Related Question