Home » Questions » Computers [ Ask a new question ]

Equivalent of chmod to change file permissions in Windows

Equivalent of chmod to change file permissions in Windows

Is there any Windows equivalent of Linux's chmod to change the permissions of a file?

Asked by: Guest | Views: 53
Total answers/comments: 4
Guest [Entry]

"There (sadly) can't be an exact equivalent, since Linux und DOS/Windows use attributes for different purposes, and (as Chathuranga said before) the security model is different:

In Windows file systems, there are ""hidden"" (H) and ""system"" (S) attributes which don't have an equivalent in Linux; there, files are hidden by prepending the name with a dot (.).
There is no equivalent to the Windows ""archive"" (A) attribute, either.
There is no equivalent to the ""executable"" (x) Linux attributes in the DOS/Windows file attributes.
There is an equivalent to the Windows ""directory"" (D) attribute (but it can't be changed anyway).
In Linux file systems, every entry is owned by exactly one user and exactly one group, and read/write/execution can be allowed for each of them, and for others. ACLs (like used by Windows) are even more flexible, but more complicated as well, and the commandline syntax is a PITA (in my humble opinion, of course)

The DOS file attribute R (read-only) is the one which might be considered to have an equivalent: this attribute set is roughly like the w attribute for all being missing; but the permission to change this attribute is subject to ACLs.

It might be cool to have a chmod/chown equivalent on Windows, perhaps written in some scripting language, which in turn calls attrib and cacls (or successors), but I don't have one."
Guest [Entry]

I use Windows command takeown.exe to change file permissions to my current logged in user id: http://technet.microsoft.com/en-us/library/cc753024.aspx
Guest [Entry]

For me, the workaround is to install Cygwin, and add its bin folder to system path. Then, if you run "chmod" in command line, it will work. Although I have not verified its correctness.
Guest [Entry]

There is nothing called chmod in windows because the security model of Windows is different than Linux. You can use attrib command to change the properties of the objects. (But they are more towards global properties.)