Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: unsetting read only flag on folder does not stick

26 Jan 2010   #1

Windows 7
unsetting read only flag on folder does not stick

A program I am running needs to access files in its folder but cannot do so because they are read only. The folder is in my Program Files (x86) folder.

When I go to the program folder and check its properties I find that it is read only. Even though I unselect the read only flag, click on Apply, say yes to all the files in the folder, and approve the admin permission to proceed, and then click on OK, when I relook at it my change to unselect read only did not stick.

What am I doing wrong?


My System SpecsSystem Spec
26 Jan 2010   #2

Windows 7

Thank you for helping.

Tried it but the folder remains read only. Weird. App works with "run as admin" but that does not explain why the attribute will not change. Is this related to UAC?

Thanks again.

Edit: I also checked and I am the owner of that folder and gave myself full control.
My System SpecsSystem Spec
26 Jan 2010   #3

64-bit Windows 10 Pro

It sounds like a privilege level issue with the program since it works with "Run as administrator". Use OPTION THREE in the tutorial below to set the program to always "Run as administrator".

Run as Administrator
My System SpecsSystem Spec

26 Jan 2010   #4

Windows 10 Pro (x64)

Folders do not have Readonly, the checkbox in the properties only effects files.
The problem you are facing is Program Files is a protected directory and unauthorized writting to this directory without running as Admin is redirected to:
An application, however, should not be writing to Program Files.
My System SpecsSystem Spec
27 Jan 2010   #5

Windows 7

Thank you all. I appreciate the help.
My System SpecsSystem Spec
27 Jan 2010   #6

Windows 7 Ultimate x64

Actually, the reason why you believe that the "Read Only" attribute change does not stick, is that when displayed for folders, the checkbox is usually filled in, which is a visual cue that the files within the folder may either be readonly or not, or a combination of the two states.

If the check box is clear, then the readonly attribute is off. If a checkmark is visible, then the attribute is set.

Also, what you should be doing is looking to update your program to a Vista/Windows 7 compatible version. NO program, regardless of it function, should be saving configuration or user data in a sub-folder of "Program Files" or "Program Files (x86)". When an application does this, it's a sign of a lazy (or worse) programmer.
My System SpecsSystem Spec
28 Jan 2010   #7

Windows 7 Home Premium

Hi Dzomlija,

I'm developing programs for WinXP but now I need to create an application for Windows 7.
After reading above posts and my own experiences, writing and deleting files under Program Files sub-folder has issues.
And you also mention that we should not write under Program Files sub-folder.
However, if we must choose another location except Program Files, I can't think of another location in win 7 folder structures.

Can you suggest me where should I save then?? (I don't have any offence. I just need a guide on that cuz i'm new to win7 and its folder structures)

or should I save my temp files under the location mentioned by logicearth?

My System SpecsSystem Spec
29 Jan 2010   #8

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)

Always save to "My Documents" for Windows XP and "Documents" for Windows 7. Temp files should always be saved to: %temp% = (C:\Users\<username>\AppData\Local\Temp) in Windows 7. It is universal so it will work in Windows XP or Windows 7
My System SpecsSystem Spec
29 Jan 2010   #9

Windows 10 Pro (x64)

Quote   Quote: Originally Posted by scsfdev View Post
Can you suggest me where should I save then?? (I don't have any offence. I just need a guide on that cuz i'm new to win7 and its folder structures)
The Old New Thing : What's the difference between My Documents and Application Data?

In Windows Vista and Seven, Application Data is C:\Users\[username]\AppData\Roaming
While Local Settings is C:\Users\[username]\AppData\Local
My System SpecsSystem Spec
29 Jan 2010   #10
Microsoft MVP

Vista and now 7 in 32 and 64 bit.

All the folders in Windows 7, as in Vista and XP, are read only. You cannot change this attribute. You can untick the box, as suggested, but, even on an empty folder, if you reopen the properties, you will find it is read only again. Windows Explorer ignores this attribute.
You can read up on the function here:
You cannot view or change the Read-only or the System attributes of folders in Windows Server 2003, in Windows XP, in Windows Vista or in Windows 7
Fwiw. Applications often write to their own folder in Program files.
My System SpecsSystem Spec

 unsetting read only flag on folder does not stick

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar help and support threads
Thread Forum
Folder read only and want all files placed in to become auto read only
Creating a new Folder as read only and would like to have all files placed into that new Folder become read only as they are added or moved into that read only Folder. If Windows 7 cannot handle this is there any kind of software utility Haddon I can get to perform this task?
General Discussion
Recycle Bin folder view settings won't stick when accessed via desktop
Hi, all. For years now I've accessed my Recycle Bin via its original system-supplied desktop icon and it comes up in Explorer with the settings I made years ago - List view, sort descending by Date Deleted. I just accessed it and it is now coming up Tiles view, ascending Name order and changing the...
General Discussion
public tv folder read only? mythtv needs read write persmissions
I tried unchecking read only. When apply and look it is back to read only. How can I make this read and write permission?
Network & Sharing
Windows 7 does not read Sony Memory Stick Pro Duo
I changed from Vista to Windows 7 32 bit. My Gateway model MD7329u laptop now does not display under My Computer, the Sony Memory Stick Pro Duo camera card when insterted into the Gateway card reader slot. How can I get this feature back?
Music, Pictures & Video
Recycle bin folder view settings will not stick
I want to keep a "details" view in the recycle bin of Windows 7 Home Premium. I had no trouble doing that until a couple of days ago. Now, the recycle bin wants to show "tiles" view. Always. There is a dropdown list on the upper right of the recycle bin where you can choose the setting....
General Discussion
Cannot read USB stick - tricky fix
My wife keeps most of her data on a USB stick so that she can easily move it around her 3 laptops (in 3 different locations). This morning, the stick was dead. It did not say a piep, no power, nothing. Despite my constant preaching about the importance of backups, she had, of course, not backed it...
Hardware & Devices

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 13:19.

Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App