Windows change access permissions from the command line

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 /?

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 2 comments… read them below or add one }

1 Top Coder - Ankit Baphna 11.13.08 at 8:08 am

You can use *.* in place of files to change access mode of multiple files at a time.

2 Alex 05.16.09 at 7:28 am

Super dude.. i got in a right time.. thanks for your contribution and sharing of knowledge..keep doing..

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: How do I find out if my Linux server CPU can run a 64 bit kernel version (apps) or not?

Next post: Configure static routes in Debian or Red Hat Linux systems