Change access permissions in command prompt
Q. I'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.
This error command:
C:\>CACLS \\192.168.2.205\Public\ /e /p Everyone:f
The specified network name is no longer available.
My fault is... I make permission using Windows 10 then after I downgrade my PC to Windows 7 because of my system only allowed Windows 7 to running the system. After the downgrade my Windows 7 PC can't allow to open network storage. What should I do? There is another alternative to set the permission? Help me please...
This error command:
C:\>CACLS \\192.168.2.205\Public\ /e /p Everyone:f
The specified network name is no longer available.
My fault is... I make permission using Windows 10 then after I downgrade my PC to Windows 7 because of my system only allowed Windows 7 to running the system. After the downgrade my Windows 7 PC can't allow to open network storage. What should I do? There is another alternative to set the permission? Help me please...
This error command:
C:\>CACLS \\192.168.2.205\Public\ /e /p Everyone:f
The specified network name is no longer available.
My fault is... I make permission using Windows 10 then after I downgrade my PC to Windows 7 because of my system only allowed Windows 7 to running the system. After the downgrade my Windows 7 PC can't allow to open network storage. What should I do? There is another alternative to set the permission? Help me please...
user:perm
I want to say: all users are aloowed to full control
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 it is showing access denied. Please tell me what to do? It is very important.
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....
please...
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 ....