2

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.

Thanks.

3 Answers 3

3
+100

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.

source

4
  • By using takeown it shows: 'takeown' is not recognized as an internal or external command,operable program or batch file.
    – bunty
    Sep 28, 2010 at 5:31
  • I added above an alternative method.
    – harrymc
    Sep 28, 2010 at 6:05
  • second method is working... Thanx... but, why takeown is not working?
    – bunty
    Sep 29, 2010 at 5:09
  • It should be available in C:\Windows\System32\takeown.exe
    – harrymc
    Sep 29, 2010 at 6:13
0

I suspect you'll have better luck if you remove it with this command:

cacls d:\test /E /P asdsd14:F

What you're doing in the first command is adding a Deny ACL. The following two commands do exactly the same thing:

cacls d:\test /E /G asdsd14:N
cacls d:\test /E /D asdsd14

What my suggested command does is replace (/P flag) that Deny acl with a Full Control ACL

1
  • still it is showing, processed dir: d:/test But folder is not opened,.
    – bunty
    Sep 25, 2010 at 5:20
0

Now cacls has been depreciated, so i will use icacls:

takeown /f /r d:\test
icacls d:\test /grant username:F

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .