How to restore Windows XP file permissions

Since I don't know my way around windows very well (how odd that I can admit this without hesitation), I usually install cygwin first thing I have to work on Wintel.

Somehow, my windows permissions got screwed up. The good old chmod under cygwin didn't do the trick: Windows is using some sort of ACL.

After long and ardous googeling, I found the following links that allow the download and provide explanation of Windows support tools (all CLI) that help you deal with certain issues

For cygwin to use the chmod command sucessfully, one has to set the Cygwin Environment Variable according to these instructions:

When consulting the CygWin documentation we quickly discovered that CygWin has two ways of dealing with file permissions. Under Windows 9x files are always readable and CygWin checks the native read-only mode to determine if they are writable. Files that have a name ending with .exe, .bat, .com or content that begins with #! are executable. It follows that the chmod (change owner) command only affects the write mode. This way of dealing with the file permissions is default on NT as well. However, on NT, you have the opportunity to make the file system behave more like Unix systems by setting the CYGWIN environment variable to ntea (NT Extended Attributes). According to the CygWin documentation this works well on NTFS partitions, but not so well with FAT partitions. We set the CYGWIN variable to ntea in /Cygnus/cygwin-b20/cygnus.bat. We were now able to set the permissions as we wanted. Still, we can't quite figure out the connection between traditional UNIX style group/other permissions and NT. The group/other permissions do not have any effect on the ACLs (Access Control Lists). The ACLs on the other hand can be changed with the cacls command, and it actually works in both NT and CygWin.

Your rating: None Average: 3.4 (105 votes)