Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alter folder permission in windows command line? [duplicate]

Tags:

windows

cmd

Possible Duplicate:
How to grant permission to users for a directory using command line in Windows?

I want to grant all users of a system the permissions of read, write and modify for a folder. I think there would be a command line that I use to do that, but if there is nothing and I have to write a code for it please help me with it.

Main Problem is that I want to grant these permissions to all users, usually I don't care about UserNames and I want to put "*" instead of usernames, to apply new permissions for all users.

any idea? Thanks.

like image 386
Reza Ameri Avatar asked Oct 04 '12 10:10

Reza Ameri


People also ask

How do I copy folder permissions?

To preserve permissions when files and folders are copied or moved, use the Xcopy.exe utility with the /O or the /X switch. The object's original permissions will be added to inheritable permissions in the new location.

How do I give permission to 777?

root user run the chmod -R 777 / command and all file permissions for the entire system have read/write/execute for every user.


1 Answers

There is a command line - CACLS.

For example, to add "Everyone" with "Full Control" to the folder c:\temp\test you would use:

REM /t means "apply change recursively"
REM /e means "edit existing DACL". 
REM     Omitting this will overwrite the existing DACL.
cacls c:\temp\Test /t /e /g Everyone:f
like image 166
RB. Avatar answered Oct 01 '22 20:10

RB.