Read-only File and Folder Attribute How to Set and Unset the Read-only File and Folder Attribute in Windows  Information  Note - Read-only box blue = Default setting. File is not read-only. For a folder, it means all files in the folder not to be set as read-only.
- Read-only box checked = File is read-only. For a folder, it means all files in the folder are set to be read-only when applied.
- Read-only box empty = 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.
METHOD ONE
Through the File or Folder Properties Page
NOTE: This option is if you want to select one file to set or unset as read-only.1. Select one or more files, then right click on the file(s) and click on Properties. 2. To Set the File as Read-onlyA) In the General tab, check the Read-only box, and click on OK. (see screenshot below)
3. To Set the File as Not Read-onlyA) In the General tab, uncheck the Read-only box, and click on OK. (see screenshot below)
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 on Properties. 2. Click 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. 3. To Set All Files in a Folder as Read-onlyA) Click twice on the blue Read-only box to check it, and click on OK. (see screenshot below) B) Select the option you want, and click on OK. (see screenshot below) NOTE: You will only be able to select the top option if you selected more than one folder.
4. To Set All Files in a Folder as Not Read-onlyA) Click once on the blue Read-only box to have it empty and unchecked, and click on OK. (see screenshot below) B) Select the option you want, and click on OK. (see screenshot below) NOTE: You will only be able to select the top option if you selected more than one folder.
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, then right click on the file(s) and click on Properties. 2. To Set as Read-onlyA) In the General tab, check the Read-only box, and click on OK. (see screenshot below) B) Select the option you want, and click on OK. (see screenshot below)
3. To Set as Not Read-onlyA) In the General tab, uncheck the Read-only box, and click on OK. (see screenshot below) B) Select the option you want, and click on OK. (see screenshot below)
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.
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-onlyA) 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"
3. To Set a File as Not Read-onlyA) 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" 
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 a elevated command prompt. 2. To Set All Files in a Folder and subfolders as Read-onlyA) 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 
3. To Set All Files in Folder and subfolders as Not Read-onlyA) 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 
That's it,
Shawn |  Published by | | Administrator Join Date: Oct 2008 Location: Texas Posts: 37,303 | |
 Tutorial Tools | | | | | |