Read-only File and Folder Attribute

ByLine
How to Set and Unset the Read-only File and Folder Attribute in Vista
Synopsis
This will show you how to set and unset the read-only attribute of a file or folder in Vista.
How to Set and Unset the Read-only File and Folder Attribute in Vista

information   Information
By default in Vista, folders do not have a read-only attribute. Only files have a read-only attribute. Any changes to the folder's read-only box will only affect the files inside the folder, then the read-only box will default back to blue when you check it again.


This will show you how to set and unset the read-only attribute of a file or folder in Vista.
Note   Note
Read-only files cannot be modified. They can only be copied, moved, renamed, or deleted.
  • Read-only box blue = File or folder is not read-only. Default setting.
  • Read-only box checked = File or folder is set as read-only.
  • Read-only box empty = File or folder is currently being set as not read-only.
warning   Warning





METHOD ONE
Through the File or Folder Properties Page




OPTION ONE
Through a Folder Properties Page
1. Right click on a folder that you want to make the files inside of it read-only, and click on Properties.​
NOTE: The read-only box will always default back to being filled in with blue. A undetermined state of not being read-only. This is not read-only.​
2. Click the General tab. (See screenshot below)​
Folder_Properties1.jpg

3. To Set Files in Folder as Read-only -
A) Check the Read-only box and click OK. (See screenshot below)​
NOTE: This will only set the read-only attribute for all of the files in this folder and it's subfolders. It does not affect the folder itself. See: Microsoft Help and Support: KB326549
Folder_Properties2.jpg

B) Click on OK to confirm changes. (See screenshot below)​
Confirm_Set_Changes.jpg


4. To Unset Files in the Folder as Read-only -
NOTE: If the folder is a system folder, then you may need to use METHOD TWO below to remove the read-only attribute of the files in the folder instead.​
A) Click on the Read-only box until it is blank without the blue square. (See screenshot below)​
NOTE: This will unset the read-only attribute for all of the files in this folder and it's subfolders. It does not affect the folder itself.
Unset_Folder_Properties.jpg

B) Click on OK. (See screenshot above)​
C) Click on OK to confirm changes. (See screenshot below)​
NOTE: If this is a system folder, then you will have to approve the other pop-ups as well.​
Confirm_Unset_Changes.jpg






OPTION TWO
Through a File Properties Page
1. Right click on the file you want to make read-only, and click on Properties.​
2. Click on the General tab. (See screenshots below)​
3. To Set a File as Read-only -
A) Check the Read-only box. (See right screenshot below step 4)​
B) Go to step 5.​

4. To Unset a File as Read-only -
NOTE: If this was a system file, then you may need to use METHOD TWO below to remove the read-only attribute instead.​
A) Uncheck the Read-only box. (See left screenshot below)​
NOTE: To unset read-only for all files in a folder, see step 4 in the above section.
File_Properties1.jpg File_Properties2.jpg


5. Click on OK to apply. (See screenshots above)​
NOTE: If this is a system file, then you will have to approve the other pop-ups as well.​





METHOD TWO
Through a Command Prompt with the ATTRIB Command




OPTION ONE
For a File
NOTE: This options is if you want to set or unset a file as read-only.​
2. To Set a File as Read-only -
A) In the command prompt, type attrib +r "Full path of file" and press Enter. (See screenshot below)​
NOTE: Substitute "Full path of file" for the actual full path of the file.
For example, attrib +r "C:\Users\Moderator\Desktop\Test.txt"
B) Go to step 4.​
CMD-1 - Copy.jpg


3. To Unset a File as Read-only -
A) In the command prompt, type attrib -r "Full path of file" and press Enter. (See screenshot below)​
NOTE: Substitute "Full path of file" for the actual full path of the file.
For example, attrib -r "C:\Users\Moderator\Desktop\Test.txt"
CMD-2 - Copy.jpg


4. Close the elevated command prompt.​
5. You can verify the read-only status of the file using METHOD ONE (Option Two) above.​




OPTION TWO
For a Folder
NOTE: This option is if you want to set or unset all files in a folder as read-only.​
2. To Set All Files in a Folder as Read-only -
A) In the command prompt, type the command below and press Enter. (see screenshot below)​
NOTE: Substitute Full path of folder for the actual full path of the folder.
Code:
attrib +r "[B][COLOR=red]Full path of folder[/COLOR][/B]\*.*" /S /D
FOR EXAMPLE: I would type this command exactly as below for a folder on my desktop.​
Code:
attrib +r "C:\Users\UserName\Desktop\Folder\*.*" /S /D


3. To Unset All Files in Folder as Read-only -
A) In the command prompt, type the command below and press Enter. (see screenshot below)​
NOTE: Substitute Full path of folder for the actual full path of the folder.
Code:
attrib -r "[B][COLOR=red]Full path of folder[/COLOR][/B]\*.*" /S /D
FOR EXAMPLE: I would type this command exactly as below for a folder on my desktop.​
Code:
attrib -r "C:\Users\UserName\Desktop\Folder\*.*" /S /D


That's it,
Shawn




 
Last edited by a moderator:
Shawn Brink

Comments

Got a question, Shawn.

I've wondered and wondered how I can save and print a list of the songs I have in my "Music" folder. Can I do that by designating them as "Read-Only Files" and if I do so, will it adversely affect the music files themselves?

And can I then change the file extension from txt to mp3 or wav?
 
Hi Sooner1938,

I do not see how setting it to Read-only would affect how you can print, but you will not be able to change the music file with it set as this.

I have changed WMA to WAV with success. I'm not sure about the success with the other formats. TXT would not be a music file, and would not work wen changed to MP3 or WAV.


This will show you how to make a TXT file with a list of your Music file directory in the command prompt. You can then print the TXT in Notepad or Wordpad. See:

How to Save and Print a File and Folder Directory List in Vista

Shawn
 
Thanks for the suggestions, Shawn.

I think I'll do it the second way you suggested, since I'm still not comfortable trying anything that involves the directory.
 
Your welcome Sooner1938,

Ok, that would most likely be the easiet way. I hope it gets you what you wanted.

Shawn
 
Hi Ninja,

I agree. I just wanted to keep it simple for everyone.

This discusses using the attrib command for people that are interested:

PROBLEM: You Cannot View or Change the Read-Only or System Attribute of Folders
See: Microsoft Help and Support: KB326549

Thank you, :geek:
Shawn
 
I have a similar problem: I run Vista home premium 32bit. All new folders I created have read-only blue box and I can't rename them or delete them. Are there any way I can set the default to 'NO BLUE BOX' on ready-only when a new folder is created? In other word, make the default new folder attribute to be r/w/delete/rename/all whatever. After all, it's the folder I created, I want to be able to do any way I want without going thru reseting the attributes. At times, I had to reset many levels of the folder above before a folder can be renamed or deleted. Oh, yes. After the Property==> unccheck the read-only==>Apply changes to folder subfolders files etc.==> Apply==> OK, I had to close the folder one level above of it and re-open to make the the attribute change to take effect. It's annoying to say the least.

Jku00v.
 
Hi jku00v,

The blue box in the read-only for a folder does not mean it is read-only. A folder in Vista cannot be set as read-only. It will always default back to the blue box. Checking read-only on a folder will only make every file in it read only, not the folder.

Where is the folder located? You may need to temporarily move the folder to the desktop or in a user folder to rename it.

If that does not help, then you can try taking ownership of the folder.

How to Take Ownership of a Item in Vista

Shawn
 
Hi jku00v,

The blue box in the read-only for a folder does not mean it is read-only. A folder in Vista cannot be set as read-only. It will always default back to the blue box. Checking read-only on a folder will only make every file in it read only, not the folder.

Where is the folder located? You may need to temporarily move the folder to the desktop or in a user folder to rename it.

If that does not help, then you can try taking ownership of the folder.

How to Take Ownership of a Item in Vista

Shawn
A followup question - after a folder has been set to be read-only (via METHOD ONE above, in my case), would every document newly added into or created inside that folder also be read-only automatically?
 
Emarell,

No, the new added files will not be read-only automatically. They would have to be manually set to read-only.

Sorry,
Shawn
 
This does not help, I change the read only for the folder, and do include sub directory. I close my explorer, re-open and the folder is tagged read-only again.
 
Hello MCharland, and welcome to Vista Forums.

If you are seeing a blue square for "Read only", then it is not marked as read-only by default. The blue just stands for a undetermined blank state. Only if it had a check mark in the box would it be marked as read-only.

Are you seeing a check mark or blue square?
 
Shawn, I have been a windows user since the early days and a Windows 7 user since it was released.

I only recently started having this issue after an update. It does make all the files and folders flag as read only. It may show up as a blue box or undetermined state but when it comes to certain programs wanting to write into that folder or files being saved within an error occurs saying that it cannot be done because the folder is READ ONLY.

No offense to you, in most cases your solution should work. But in this situation they do not. I have been to several forums on this issue as well and none have solutions that work. Tried the attrib, tried permissions, tried making it read only and switching it to non-read only and it automatically switches right back. I have ownership of said folder and files as I am also the administrator

Something is amiss and things are not working as they should.
 
Hello Neodrath, and welcome to Vista Forums.

To be safe, I would recommend that you do a full scan of your system with Malwarebytes free to see if you may have been infected with malware or a virus.

What's the full path of the folder that is having this issue? Please also post a screenshot showing this folder highlighted in Windows Explorer to see if anything may stand out.
 
Hi Shawn, I don't know if I can get some help for my Vista system, since most comments on this page date back a few years it could be that you guys don't offer any support anymore... hence my question if I could get some help?

I turned to this page because I assumed that my problem was caused by the blue Read-only box of a folder, but after reading & testing everything on this thread, also in the link to the Microsoft database: 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 my problem persisted, so I may be posing my question in the wrong thread... Nonetheless, here goes:

I have a data partition E:\ and basically all folders have that blue Read-only box, no problem here but I wanted to rename an .mp3 file and a while later the name of that file returned to its previous name, automatically. Very weird! Do you know what causes this?

PS I addressed to Shawn, but anyone with sufficient knowledge can help me out.

Thanks in advance!
 
Hello Carlo,

Since you are able to rename the file, it wouldn't be read-only.

As a test, move the .mp3 file to your desktop and rename it to see if the new name stays. I'm thinking that something that uses that file may be auto saving/changing it with the original name.
 
Hi Shawn, thanks for your reply!

I copied the mp3 file to my Desktop, changed its name... waited a while & it stayed the same.
So you were right buddy, some other program must have had control over my music files.

I use Windows Media Player and I installed Windows Media Player Plus a few weeks ago, so that must be it.
As a mere test I uninstalled Windows Media Player Plus, renamed the file on E:\ & now I'm waiting for the result...

Tick tock ;)

... still waiting...

Ok... I waited a half hour and the file I renamed remains that way. Problem solved!

Thanks alot Shawn!
 
Top