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: Read-only File and Folder Attribute


Read-only File and Folder Attribute

How to Set and Unset Read-only Attribute of a File or Folder in Windows
Published by Brink
14 Feb 2010
Published by

How to Set and Unset Read-only Attribute of a File or Folder in Windows


information   Information
This tutorial will show you how to set or unset files or all files in folders to be read-only or not in Vista, Windows 7, and Windows 8.

In Windows, folders cannot be set as read-only. Only the files in the folders can be.

If 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


Note   Note

  • Name:  dot.jpg
Views: 46624
Size:  864 Bytes Read-only box = (Windows 8) Default neutral setting for a folder that is always displayed.
  • Name:  blue_Neutral.jpg
Views: 33405
Size:  869 Bytes Read-only box = (Vista and Windows 7) Default neutral setting that is always displayed. File is not read-only. For a folder, it means all files in the folder not to be set as read-only.
  • Name:  checked.jpg
Views: 46181
Size:  879 Bytes Read-only box = File is read-only. For a folder, it means all files in the folder are set to be read-only when applied. Only displays temporarily while setting it.
  • Name:  empty.jpg
Views: 46190
Size:  878 Bytes Read-only box = File is not read-only, or to set file as not read-only when applied. For a folder, it means all files in the folder are set to be not read-only when applied. Only displays temporarily while setting it.



METHOD ONE
Through the File or Folder Properties Page



OPTION ONE
For a File

NOTE: This option is if you want to select one file to set or unset as read-only.
1. Select one or more files, right click on the file(s), and click/tap on Properties.

2. To Set the File as Read-only
A) In the General tab, click on the Read-only box until checked, and click/tap on OK. (see screenshot below)
Name:  File2.jpg
Views: 27070
Size:  107.3 KB
3. To Set the File as Not Read-only
A) In the General tab, click on the Read-only box until unchecked, and click/tap on OK. (see screenshot below)
Name:  File1.jpg
Views: 28407
Size:  109.5 KB



OPTION TWO
For a Folder

NOTE: This option is if you want to have all files in a folder set or unset as read-only.
1. Select one or more folders, then right click on the folder(s), and click/tap on Properties.

2. Click/tap on the General tab. (see screenshot below)
NOTE: When the Read-only box is blue, this is the default undetermined state. It does not mean read-only or not read-only.
Name:  Step1.jpg
Views: 26912
Size:  96.3 KB
3. To Set All Files in a Folder as Read-only
A) Click on the Read-only box until checked, and click on OK. (see screenshot below)
Name:  Step3.jpg
Views: 26757
Size:  99.2 KB
B) Select the option you want, and click/tap on OK. (see screenshot below)
NOTE: You will only be able to select the top option if you selected more than one folder.
Name:  Step3B.jpg
Views: 26727
Size:  63.5 KB
4. To Set All Files in a Folder as Not Read-only
A) Click on the Read-only box until it's empty, and click/tap on OK. (see screenshot below)
Name:  Step2.jpg
Views: 26754
Size:  96.2 KB
B) Select the option you want, and click/tap on OK. (see screenshot below)
NOTE: You will only be able to select the top option if you selected more than one folder.
Name:  Step2B.jpg
Views: 26664
Size:  63.8 KB



OPTION THREE
For Multiple Files and Folders

NOTE: This option is if you want to select multiple files and folders at once to have the files and all files in the folders set or unset as read-only.
1. Select one or more files and/or folders, right click on the file(s), and click/tap on Properties.

2. To Set as Read-only
A) In the General tab, click on the Read-only box until checked, and click/tap on OK. (see screenshot below)
Name:  File-folder2.jpg
Views: 26666
Size:  77.2 KB
B) Select the option you want, and click/tap on OK. (see screenshot below)
Name:  File-folder2b.jpg
Views: 26612
Size:  67.7 KB
3. To Set as Not Read-only
A) In the General tab, click on the Read-only box until unchecked, and click/tap on OK. (see screenshot below)
Name:  File-folder1.jpg
Views: 26660
Size:  76.4 KB
B) Select the option you want, and click/tap on OK. (see screenshot below)
Name:  File-folder1B.jpg
Views: 26602
Size:  67.9 KB



METHOD TWO
Through a Command Prompt with the ATTRIB Command

NOTE: While you can do this with a non-elevated command prompt or a elevated command prompt, you may get better results using a elevated command prompt if you are logged in as an administrator.



OPTION ONE
For a File

NOTE: This options is if you want to set or unset a file as read-only.
1. Open a non-elevated command prompt or a elevated command prompt.

2. To Set a File as Read-only
A) In the command prompt, type the command below, and press Enter. (see screenshot below)
NOTE: Substitute "Full path of file with file extension" for the actual full path of the file.

Code:
attrib +r "Full path of file with file extension"
FOR EXAMPLE: I would type this command exactly as below for a file named file.txt in a folder on my desktop.

Code:
attrib +r "C:\Users\UserName\Desktop\Folder\File.txt"
Name:  File-set_Read-only_command.jpg
Views: 26789
Size:  55.9 KB
3. To Set a File as Not Read-only
A) In the command prompt, type the command below, and press Enter. (see screenshot below)
NOTE: Substitute "Full path of file with file extension" for the actual full path of the file.

Code:
attrib -r "Full path of file with file extension"
FOR EXAMPLE: I would type this command exactly as below for a file named file.txt in a folder on my desktop.

Code:
attrib -r "C:\Users\UserName\Desktop\Folder\File.txt"
Name:  File-unset_Read-only_command.jpg
Views: 26782
Size:  57.5 KB



OPTION TWO
For a Folder

NOTE: This option is if you want to set or unset all files in a folder and it's subfolders as read-only.
1. Open a non-elevated command prompt or an elevated command prompt.

2. To Set All Files in a Folder and subfolders 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 "Full path of folder\*.*" /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
Name:  Folder-set_Read-only_command.jpg
Views: 26801
Size:  56.7 KB
3. To Set All Files in Folder and subfolders as Not 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 "Full path of folder\*.*" /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
Name:  Folder-unset_Read-only_command.jpg
Views: 27049
Size:  56.3 KB
That's it,
Shawn



Comment

 Read-only File and Folder Attribute




Tutorial Tools





Similar help and support threads
Windows 7 Tutorial Category
File and Folder Read only attribute wont disable
When i create a new folder it automatically sets the read only attribute, if i try and turn it off it just turns back on again. I have tried using command prompt to disable it as well as playing with the security settings and account permissions. does any one have any ideas?
System Security
Remove read only attribute of folder.
I have an executable file, which is a windows service. Now I cannot start it from service control management panel. I am the administrator. I guess the readonly attribute effects it. I found that the folder is readonly. I unclick it and apply it and click OK button. However next time when I look...
General Discussion
change Read only attribute
Recently I formatted my hard drive and all my data was again copied from different Hard drive.I use win 7 ultimate .This has resulted in the READ only Tried using properties and attrib command, both failed. How do I change the files to read/write? I have more than 300GB data.Whenever I try to...
General Discussion
Can't remove 'read-only' attribute from a folder
Things I have tried: 1) Enabled hidden administrator logon and logged onto it. 2) Edited user permission for entire drive and set to 'full control' 3) verified the folder is not locked/in-use even deleted it and then restored Still has the stupid 'read only' box checked when you hit...
General Discussion
"Read-Only" File Attribute
Windows 7 will delete "Read-Only" files without providing any warning (unlike XP).:mad: Windows Media Player 12 will overwrite files which have the "Read-Only" attribute set.:mad: Does anyone know how to make Windows 7 (& WMP) obey the "Read-Only" attribute on files?:confused:
General Discussion
How do I unset the Program folder read-only attribute?
Hello everybody, I have a problem with the C:\Programs Files and C:\Program Files (x86) folders under W7 RC 64bit: these folder have the read-only attribute set on and I can't unset it. Whenever I tried to unset this attribuite even if W7 seems to comply the folders actually remain in the...
General Discussion

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 11:48.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App