Read-only File and Folder Attribute

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


   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
  • dot.jpg Read-only box = (Windows 8) Default neutral setting for a folder that is always displayed.
  • blue_Neutral.jpg 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.
  • checked.jpg 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.
  • empty.jpg 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)
File2.jpg
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)
File1.jpg



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.
Step1.jpg
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)
Step3.jpg
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.
Step3B.jpg
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)
Step2.jpg
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.
Step2B.jpg



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)
File-folder2.jpg
B) Select the option you want, and click/tap on OK. (see screenshot below)
File-folder2b.jpg
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)
File-folder1.jpg
B) Select the option you want, and click/tap on OK. (see screenshot below)
File-folder1B.jpg



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 "[B][COLOR=red]Full path of file with file extension[/COLOR][/B]"
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"
File-set_Read-only_command.jpg
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 "[B][COLOR=red]Full path of file with file extension[/COLOR][/B]"
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"
File-unset_Read-only_command.jpg



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 "[B][COLOR=red]Full path of folder[/COLOR][/B]\*.*" /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
Folder-set_Read-only_command.jpg
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 "[B][COLOR=red]Full path of folder[/COLOR][/B]\*.*" /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
Folder-unset_Read-only_command.jpg
That's it,
Shawn





 
Last edited:
None of this works it always come back with Read-only folder. Can you make your "Take ownership" solution in french please?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
compac
OS
win7 family premium sp1
CPU
intel core i5 2310 cpu-290hz 644 bits
Memory
8 gig
Graphics Card(s)
nvidia
Antivirus
avira, malwarebytres, roguekiller
Browser
chrome
Hello Zorro, and welcome to Seven Forums. :)

Technically, you can't set a folder as read-only as it gets applied to the files in the folder instead.

If the files in this folder do not have a check mark in the read-only box, then they are not read-only.

Taking ownership of a file or folder will not change its attribute (ex: read-only). It will only change its permissions instead. Here'a French version below that you requested though.

View attachment French-Add_Take_Ownership_with_Pause_to_context_menu.reg
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Back
Top