Related Items  

Linux and Windows IT Support  

We make IT Support easy!

Windows, Apple and Linux IT support and services.

For Software and Web Development.

Login or Register  

If you wish to contribute an article, please login or register.

Change access permissions in command prompt

PrintE-mail

Q. Command-Prompt-iconI'm logged in as a non-privileged user and would like to change file permissions. How do I do that without logging out?

A. 1. First you have to open the command prompt as a privileged user. That can be found under Start -> "All Programs" -> Accessories. Right-click on the "Command prompt" icon and select "Run-As".

2. Once prompted, enter username and password.

3. On the command line, you can use a comman called CACLS. Here's the full list of things that it can do:

Displays or modifies access control lists (ACLs) of files
CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]
               [/P user:perm [...]] [/D user [...]]
   filename      Displays ACLs.
   /T            Changes ACLs of specified files in
                 the current directory and all subdirectories.
   /E            Edit ACL instead of replacing it.
   /C            Continue on access denied errors.
   /G user:perm  Grant specified user access rights.
                 Perm can be: R  Read
                              W  Write
                              C  Change (write)
                              F  Full control
   /R user       Revoke specified user's access rights (only valid with /E).
   /P user:perm  Replace specified user's access rights.
                 Perm can be: N  None
                              R  Read
                              W  Write
                              C  Change (write)
                              F  Full control
   /D user       Deny specified user access.
Wildcards can be used to specify more that one file in a command.
You can specify more than one user in a command.

Abbreviations:
   CI - Container Inherit.
        The ACE will be inherited by directories.
   OI - Object Inherit.
        The ACE will be inherited by files.
   IO - Inherit Only.
        The ACE does not apply to the current file/directory.

So if you want to add permissions to a folder called "Shared", located on C: drive for Everyone, do the following:

C:\cacls c:\Shared /e /p Everyone:f

Where /e is to preserve old permissions;
/p is to add new permissions;
Everyone is the user
f stands for Full Control (R Read, W Write, C Change (write), F Full control)

If you don't include /e, the permissions assigned will be the only permissions on the file/directory.

 

Comments (8)
how to allow all users?
8 Friday, 25 May 2018 08:49
abdesslem abdou
How can I give the permission to all users

user:perm
I want to say: all users are aloowed to full control
Add and replace permission in drive D:
7 Thursday, 15 March 2018 03:44
Phann Channrithy
Dear Sir,

I have two questions for you.

1st question. I want to add new user permission into drive D: and then make it replace old permission. How should I do it?

2nd question. I want to add authenticated users into drive D: and I give the right only "read, write, and read permission. How should I do?


Thanks for your help !
STILL ACCESS DENIED
6 Tuesday, 06 March 2018 09:09
Brahamdeep SIngh
Dear Sir,
Still it is showing access denied. Please tell me what to do? It is very important.
cacls Command Issue
5 Wednesday, 20 December 2017 08:26
Deepak Kumar
Dear sir,
i am already protect our folder.
command line : d:> cacls Filename /e /p :f command is access is denied.
Help me This is my important data in this folder....
how to set ile permissions in windows file
4 Friday, 03 March 2017 08:34
vamsi
hiii
admin access
3 Thursday, 09 February 2017 01:17
ishwar
how can do edit acl info h=and how to use in cmd
please...
admin access
2 Thursday, 09 February 2017 01:11
ishwar
even give a full control access folder administrator but
its also showing Access Denied. i edited user group control also ...
i have only one user account ...it my old account file, i changed user control also.
please help me ....
VBS script to change ACL
1 Thursday, 20 September 2012 10:22
G222
There is a very powerful script xcacls.vbs that changes/edits ACL info and can be incorporated into a batch file or run from the command prompt. Best if run by cscript. Enter cscript xcacls.vbs help for a full list of sitches and options.

Add your comment

Your name:
Subject:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
yvComment v.1.24.0
   
Copyright © 1999 - 2018 Virtual Helpme | Managed IT Solutions Specialized for Your Business | Original Template: Allrounder