Answered by:

How to unset folder/file read-only attribute

Question

I've just got my new Vista laptop and am having trouble with folder properties. I'm logged in as Adminstrator because I'm the only user and its not connected to the internet, yet.

I right-click on a folder to bring up the Properties dialog. In the General tab Attributes is set to Read-only. I click on the blue box to unset this and click on OK to close the dialog. When I right-click and bring up the dialog again the Read-only attribute is still set????

How can I permanently unset the Read-only attribute?, for folders and files.

Answers

NTFS permissions can be changed using the Security tab (assuming you have it on your edition of Vista and that Simple File Sharing is disabled). Alternatively you can use a command line tool such as cacls.exe to alter permissions.

The state of the read only flag on a folder is meaningless, it exists only to allow you to reset the state of all files in the current directory (or subdirectories) if you so choose. Files that are marked as Read Only might be treated as read only by some applications but there is no real guarantee of that (notice that Explorer will quite happily let you delete them). Generally speaking there is little point changing it.

Writing to Program Files is a privileged operation that can normally only be done from an elevated application. You'll probably find that the log file write has been virtualised and stored in your user profile. If you navigate to the directory in Explorer and then click the Compatability Files button at the top it will take you to the location of the virtualised write (something like %userprofile%\AppData\Local\VirtualStore\Program Files\)

All replies

The read only attribute on folders is a legacy throwback from DOS. Windows uses it to determine whether the folder has a customized Explorer view, changing it in the GUI won't actually make any difference.

If you have issues changing the contents of folders, you probably want to check the NTFS permissions rather than the attributes (though some older applications will respect the read only attribute on individual files)

NTFS permissions can be changed using the Security tab (assuming you have it on your edition of Vista and that Simple File Sharing is disabled). Alternatively you can use a command line tool such as cacls.exe to alter permissions.

The state of the read only flag on a folder is meaningless, it exists only to allow you to reset the state of all files in the current directory (or subdirectories) if you so choose. Files that are marked as Read Only might be treated as read only by some applications but there is no real guarantee of that (notice that Explorer will quite happily let you delete them). Generally speaking there is little point changing it.

Thanks for that comprehensive answer! I checked on the Security tab and as administrator I have got full access.

The reason it came up was because I installed a program (in Program Files) that is supposed to create and write to an error log in the Program Files directory, but it never appears. Works fine on my XP desktop but no luck with the Vista laptop. I assumed it must be because Program Files is permanently Read-only enabled. Sounds like there might be an issue with the program itself, but I can't think what though.

Writing to Program Files is a privileged operation that can normally only be done from an elevated application. You'll probably find that the log file write has been virtualised and stored in your user profile. If you navigate to the directory in Explorer and then click the Compatability Files button at the top it will take you to the location of the virtualised write (something like %userprofile%\AppData\Local\VirtualStore\Program Files\)

I've just got my new Vista laptop and am having trouble with folder properties. I'm logged in as Adminstrator because I'm the only user and its not connected to the internet, yet.

I right-click on a folder to bring up the Properties dialog. In the General tab Attributes is set to Read-only. I click on the blue box to unset this and click on OK to close the dialog. When I right-click and bring up the dialog again the Read-only attribute is still set????

How can I permanently unset the Read-only attribute?, for folders and files.

I'm also using a program that needs write access to the program files directory. Is there any way to allow this? I get a message that only the administrator can do this, but I am the administrator on my PC. Is this just a security feature that can be disabled? My program won't allow my to exit without writing to a log. Thanks!

Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.