 Published by | | |
 Featured Tutorial | | | How to Set and Unset Read-only Attribute of a File or Folder in Windows
 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-onlyA) In the General tab, click on the Read-only box until checked, and click/tap on OK. (see screenshot below)
3. To Set the File as Not Read-onlyA) In the General tab, click on the Read-only box until unchecked, and click/tap on OK. (see screenshot below)
 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. 3. To Set All Files in a Folder as Read-onlyA) Click on the Read-only box until checked, and click on OK. (see screenshot below) 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.
4. To Set All Files in a Folder as Not Read-onlyA) Click on the Read-only box until it's empty, and click/tap on OK. (see screenshot below) 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.
 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-onlyA) In the General tab, click on the Read-only box until checked, and click/tap on OK. (see screenshot below) B) Select the option you want, and click/tap on OK. (see screenshot below)
3. To Set as Not Read-onlyA) In the General tab, click on the Read-only box until unchecked, and click/tap on OK. (see screenshot below) B) Select the option you want, and click/tap 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.
 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-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" 
 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-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 |