How can I change Windows 7 file permissions using the command prompt?

I want to change permissions in program files, but cacls is not working for me.

link|improve this question
feedback

3 Answers

To change permissions, use an administrator account on that machine to run CACLS. If you have UAC enabled, you may have to elevate the command prompt first by right-clicking on it and choosing "Run as Administrator".

You can use cacls 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:
      o R - Read
      o W - Write
      o C - Change (write)
      o F - Full control

For example, to grant your user account full (F) control to files, you would use the following command (typed in an elevated Windows command prompt):

CACLS files /e /p %USERNAME%:f

Read complete help by typing following command:

cacls /?
link|improve this answer
feedback

cacls is depcriated in Windows 7. You need to use ICACLS instead of cacls.

ICACLS "filename" /grant "Users":F

This command is granting the privileges.

link|improve this answer
feedback

you need to run cacls with administrator right in order to change permission in program files...

link|improve this answer
how to run cacls as administrator using command itself? – sam Dec 15 '10 at 9:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.