Saturday, September 11, 2010

How to Set and Unset the Read-only File and Folder Attribute in Vista


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.jpgfile_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.
1. Open a elevated command prompt.

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.
1. Open a elevated command prompt.

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 "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
Attachment 54122
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 "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

No comments:

Post a Comment