Remove read-only attribute of a folder

How do I remove the read-only attribute of a folder. I'm not having any luck with it. I right click the folder, click Properties, uncheck read-only, click Apply, and then click OK. It appears to work but when I check the properties again the folder is still read-only.
Who is Participating?
CrazyOneConnect With a Mentor Commented:
Hmmm I just came across this MS KB


Unable to Remove Read-Only Flag from Folder (Q256614)

The information in this article applies to:

Microsoft Windows 2000 , Advanced Server
Microsoft Windows 2000 , Professional
Microsoft Windows 2000 , Server
Microsoft Windows NT Workstation version 4.0
Microsoft Windows NT Server version 4.0
Microsoft Windows 98
Microsoft Windows 95
IMPORTANT : This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
Q256986 Description of the Microsoft Windows Registry

You may be unable to remove the Read-Only attribute from a folder using Windows Explorer. In addition, some programs may display error messages when you try to save files to the folder.

This behavior occurs because the folder is customized. You can customize a folder by clicking Customize this folder on the View menu. Many programs also customize folders (for example, the Fonts folder comes with a customization as part of the standard system configuration).

This behavior is by design.

WARNING : If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Windows Explorer uses the Read-Only attribute to determine whether or not the folder is customized. To work around this behavior, you can configure Windows Explorer to use the System flag instead of the Read-Only flag. To do this, use the following steps.

NOTE : Some programs do not operate correctly with folders that have the System attribute configured.

Start Registry Editor (Regedt32.exe).

Locate the following registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Explorer
On the Edit menu, click Add Value , and then add the following registry value:

Value Name: UseSystemForSystemFolders
Data Type: REG_DWORD
Value: 1
Quit Registry Editor.

You can find additional information about folder customization in the Platform Software Development Kit (SDK). Refer to the PathMakeSystemFolder function and the "Customizing Folders with Desktop.ini" shell basics chapter at the following Microsoft Web sites: 

Is this on all folders or just a particular one or two? Do you have administrative rights?

The Crazy One
Have you checked for virus's? Free online scanner
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

From the Windows Help

"To change properties for archiving, indexing, compression, or encryption on NTFS drives, right-click the file or folder, click Properties, click Advanced, and then select the options you want to change. "
Also this is from the Windows help file

"To set, view, change, or remove file and folder permissions

Open Windows Explorer, and then locate the file or folder for which you want to set permissions.
Right-click the file or folder, click Properties, and then click the Security tab.
Do one of the following:
To set up permissions for a new group or user, click Add. Type the name of the group or user you want to set permissions for using the format domainname\name, and then click OK to close the dialog box.
To change or remove permissions from an existing group or user, click the name of the group or user.
In Permissions, click Allow or Deny for each permission you want to allow or deny, if necessary. Or, to remove the group or user from the permissions list, click Remove.

To open Windows Explorer, click Start, point to Programs, point to Accessories, and then click Windows Explorer.
You can set file and folder permissions only on drives formatted to use NTFS.
To change permissions, you must be the owner or have been granted permission to do so by the owner.
Groups or users granted Full Control for a folder can delete files and subfolders within that folder regardless of the permissions protecting the files and subfolders.
If the check boxes under Permissions are shaded, or if the Remove button is unavailable, then the file or folder has inherited permissions from the parent folder."

If you can't remove the read-only attribute from a folder, I bet that you have a Desktop.ini file in the folder whose read-only attribute is set.

To resolve the problem, remove the read-only attribute from the Desktop.ini file, using either of the following:

- Right-click the Desktop.ini file and press Properties. Uncheck the Read-only attribute and press Apply.

- Open a CMD prompt and type: attrib -r <Drive:>\Folder\Desktop.ini
crazyone: that exactly the desktop.ini problem I mentioned.
And I guess this KB-workaround will help only to prevent future read-only problems.
Are you able to use the DOS attrib command?
Let's say your folder is located at C:\winnt\test  (and the test folder is read-only)
Open up a DOS prompt (go to start | run and type cmd
cd = change directory
dir = list
.. = go back 1 directory
c:\ = go to root
If you were to work with the test directory and you were in c:\documents and settings\all users
you would type:
then you would type:
cd winnt
this would place you in the winnt directory
now to remove the read-only attribut from the test directory you would type:
attrib -r test

Franka not exactly. The one you mentioned refers to changing the Desktop.ini file readonly flag contolling the readonly flag on the folder. I have several Destop.ini files and none of them are flagged read only but the folder they reside in is flagged readonly. Changing the readonly flag on the Destop.ini file one way or the other had no affect on the folders readonly flag. The MS KB explians about why the readonly flag is set on the folder and how to make a folder customized. Although the article doesn't mention it  you can uncustomize a folder from the View >  Customize this folder and from the wizard one can choose "Revome customization".  

Also this article explains a little bit about how the Desktop.ini is used to customize a folder and how to use the s switch wtih the attrib command to make a folder customized.

attrib +s Folder  customizes the folder
attrib -s Folder  uncustomizes the folder

"File system folders are commonly displayed with a standard icon and set of properties, which specify, for instance, whether or not the folder is shared. You can customize the appearance and behavior of an individual folder in two ways:

Create a Desktop.ini file for the folder
Create a Folder.htt template for the folder
Folders can be displayed in either Classic or Web style. For a detailed discussion of these styles, see Web View. The Desktop.ini file, discussed here, applies to both styles. It allows you to assign a custom icon to a folder and control its behavior in a limited way.

To customize the folder's style beyond what is possible with the Desktop.ini file, you must create a custom Folder.htt template for the folder. This file will only affect the appearance of the folder when the Web style is selected. If this template is not present in the folder, the Shell uses a default template. For further discussion of .htt templates, see The Web View Template.

Folders are normally displayed with the standard folder icon. The most common use of the Desktop.ini file is to assign a custom icon to a folder. This icon will be displayed in Classic style as well as Web style, and it will appear next to the folder's name anywhere the name appears. You can also use Desktop.ini to create an infotip that displays information about the folder and controls some aspects of the folder's behavior, such as whether it can be shared.

Use the following procedure to customize a folder's style with Desktop.ini:

Use PathMakeSystemFolder to make the folder a system folder. You can also make a folder a system folder from the command line by using attrib +s FolderName.
Create a Desktop.ini file for the folder. You should mark it as hidden and read-only to protect it from being modified.
Creating a Desktop.ini File
The Desktop.ini file is a text file that allows you to specify how a file system folder will be viewed. There are three sections in the file. The first two, [ExtShellFolderViews] and [{5984FFE0-28D4-11CF-AE66-08002B2E1262}] are necessary only if you want to use a custom Folder.htt template. If you omit them, the system will use the default template. To use a custom Folder.htt template, you must include these two sections into the Desktop.ini file exactly as they are shown:


The third section, [.ShellClassInfo], allows you to customize the folder's view by assigning values to several entries:

Entry Value
ConfirmFileOp Set this entry to 0 to avoid a "You Are Deleting a System Folder" warning when deleting or moving the folder.
NoSharing Set this entry to 1 to prevent the folder from being shared.
IconFile If you want to specify a custom icon for the folder, set this entry to the icon's file name. The .ico file extension is preferred, but it is also possible to specify .bmp files, or .exe and .dll files that contain icons. If you use a relative path, the icon will be available to people who view the folder over the network. You must also set the IconIndex entry.
IconIndex Set this entry to specify the index for a custom icon. If the file assigned to IconFile only contains a single icon, set IconIndex to 0.
InfoTip Set this entry to an informational text string. It will be displayed as an infotip when the cursor hovers over the folder. If the user clicks the folder in a Web view, the information text will be displayed in the folder's information block, below the standard information. "
dmoranzAuthor Commented:
CrazyOne -  Thanks! This is exactly my problem! I customized the folder and subfolders for image previews. Removing the customization didn't solve the problem. I didn't want to make the registry changes like MS KB suggests so I created new folders and moved everything out of the read-only folders.
this is why I love EE ...:-(
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.