How to Change the Read-Only Attribute for Files on Windows (2024)

When a file is marked as read-only on Windows, you can only view it and not change it in any way. This essentially protects important files from unauthorized changes.

On Windows, you can set or remove the read-only attribute for a file by modifying its properties. Alternatively, you can also run a command in Command Prompt or Windows PowerShell to do the same. In this article, we take a look at all of them.

1. How to Change the Read-Only Attribute for Files by Modifying Properties

The easiest way to set or remove the read-only attribute for a file on Windows is by modifying its properties. Here’s how you can go about it.

  1. Open File Explorer and navigate to the file for which you want to change the read-only attribute.
  2. Right-click on your file and select Properties.
  3. Under the General tab, check or uncheck the Read-only box.
  4. Click Apply followed by OK.

Note that Windows may prevent you from changing the read-only attribute of a file if you don’t have the necessary permissions to modify the folder in which the file is located. In that case, you must take ownership of the folder first. If you need help, check our guide on how to take ownership of folders on Windows.

2. How to Change the Read-Only Attribute for Files Using the Command Prompt

Command Prompt is one of two command-line tools available on Windows. You can use it to run batch files, troubleshoot errors, and perform various other tasks. It also lets you change a file's read-only attribute with a single command. Here are the steps you need to follow.

  1. Right-click on the file for which you want to modify the read-only attribute and select Copy as path.
  2. Press Win + X to open the Power User menu.
  3. Select Terminal (Admin) from the list.
  4. Select Yes when the User Account Control (UAC) prompt appears.
  5. In the console, type the following command and press Enter to set your file as read-only.
    attrib +r "FilePath" 

Replace FilePath in the above command with the actual path of the file copied earlier.

Once you run the above command, the file will be set as read-only. Likewise, if you want to remove the read-only attribute for a file, use this command:

attrib -r "FilePath" 

Once you remove the read-only attribute for a file, you should be able to edit or modify it.

Like using Command Prompt? Check our guide to learn how to master Command Prompt on Windows.

3. How to Change the Read-Only Attribute for Files Using Windows PowerShell

You can also run a command in Windows PowerShell to change the read-only attribute for a file.

To change the read-only attribute using PowerShell:

  1. Right-click on the file for which you want to change the read-only attribute and select Copy as path.
  2. Click the magnifying icon on the taskbar or press Win + S to open the search menu.
  3. Type Windows PowerShell and select Run as Administrator.
  4. Select Yes when the User Account Control (UAC) prompt shows up.
  5. Paste the following command and press Enter to set your file as read-only.
    Set-ItemProperty -Path"FilePath" -Name IsReadOnly -Value $True 

Replace FilePath in the above command with the actual path of the file copied earlier.

How to Change the Read-Only Attribute for Files on Windows (3)

Alternatively, if you want to remove the read-only attribute for a file, use this command:

Set-ItemProperty -Path"FilePath" -Name IsReadOnly -Value $False 

Modifying the Read-Only Attribute for Files on Windows

It’s worth noting that most system files on Windows will have the read-only attribute by default. So, make sure you don't modify them by mistake. For your other files, you can pick any of the above methods listed above to set or unset their read-only attribute.

How to Change the Read-Only Attribute for Files on Windows (2024)
Top Articles
Small Bank Errors Can Be A Big Headache | Bankrate.com
How to Minimize Large Pores With Makeup - L’Oréal Paris
Craigslist St. Paul
News - Rachel Stevens at RachelStevens.com
50 Meowbahh Fun Facts: Net Worth, Age, Birthday, Face Reveal, YouTube Earnings, Girlfriend, Doxxed, Discord, Fanart, TikTok, Instagram, Etc
Parks in Wien gesperrt
Kagtwt
Derpixon Kemono
Hello Alice Business Credit Card Limit Hard Pull
Tiraj Bòlèt Florida Soir
Bowlero (BOWL) Earnings Date and Reports 2024
Overton Funeral Home Waterloo Iowa
NHS England » Winter and H2 priorities
Hocus Pocus Showtimes Near Amstar Cinema 16 - Macon
Farmer's Almanac 2 Month Free Forecast
The best TV and film to watch this week - A Very Royal Scandal to Tulsa King
Tinker Repo
Jeff Now Phone Number
Timeforce Choctaw
Georgia Cash 3 Midday-Lottery Results & Winning Numbers
Qhc Learning
Encore Atlanta Cheer Competition
Somewhere In Queens Showtimes Near The Maple Theater
Ford F-350 Models Trim Levels and Packages
Air Quality Index Endicott Ny
Anotherdeadfairy
Craigslist Wilkes Barre Pa Pets
15 Primewire Alternatives for Viewing Free Streams (2024)
Firefly Festival Logan Iowa
Ullu Coupon Code
Jesus Calling Feb 13
Yu-Gi-Oh Card Database
Puretalkusa.com/Amac
Composite Function Calculator + Online Solver With Free Steps
The Ride | Rotten Tomatoes
RUB MASSAGE AUSTIN
Vip Lounge Odu
Afspraak inzien
Bimmerpost version for Porsche forum?
Avance Primary Care Morrisville
Vons Credit Union Routing Number
All Obituaries | Sneath Strilchuk Funeral Services | Funeral Home Roblin Dauphin Ste Rose McCreary MB
Stranahan Theater Dress Code
Sallisaw Bin Store
Blow Dry Bar Boynton Beach
Candise Yang Acupuncture
Understanding & Applying Carroll's Pyramid of Corporate Social Responsibility
Product Test Drive: Garnier BB Cream vs. Garnier BB Cream For Combo/Oily Skin
Home | General Store and Gas Station | Cressman's General Store | California
Unit 4 + 2 - Concrete and Clay: The Complete Recordings 1964-1969 - Album Review
Deviantart Rwby
Naughty Natt Farting
Latest Posts
Article information

Author: Otha Schamberger

Last Updated:

Views: 6257

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Otha Schamberger

Birthday: 1999-08-15

Address: Suite 490 606 Hammes Ferry, Carterhaven, IL 62290

Phone: +8557035444877

Job: Forward IT Agent

Hobby: Fishing, Flying, Jewelry making, Digital arts, Sand art, Parkour, tabletop games

Introduction: My name is Otha Schamberger, I am a vast, good, healthy, cheerful, energetic, gorgeous, magnificent person who loves writing and wants to share my knowledge and understanding with you.