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: 16930
Size:  864 Bytes Read-only box = (Windows 8) Default neutral setting for a folder that is always displayed.
  • Name:  blue_Neutral.jpg
Views: 12176
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: 16700
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: 16704
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: 7885
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: 9105
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: 7637
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: 7609
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: 7585
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: 7579
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: 7570
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: 7570
Size:  77.2 KB
B) Select the option you want, and click/tap on OK. (see screenshot below)
Name:  File-folder2b.jpg
Views: 7544
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: 7560
Size:  76.4 KB
B) Select the option you want, and click/tap on OK. (see screenshot below)
Name:  File-folder1B.jpg
Views: 7551
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: 7785
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: 7723
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: 7769
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: 7945
Size:  56.3 KB
That's it,
Shawn



Comment

 Read-only File and Folder Attribute





Tutorial Tools



Similar help and support threads for2: Read-only File and Folder Attribute
Windows 7 Tutorial Category
Solved change Read only attribute General Discussion
File and Folder Read only attribute wont disable System Security
Read only attribute stuck on Software
Can't remove 'read-only' attribute from a folder General Discussion
Solved "Read-Only" File Attribute General Discussion
Can't uncheck read-only attribute General Discussion
How do I unset the Program folder read-only attribute? 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 01:21 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33