How to make a file read-only: 6 steps

Table of contents:

How to make a file read-only: 6 steps
How to make a file read-only: 6 steps
Anonim

You create a file and put important information in it, you do not want to accidentally delete it and for security purposes it would be nice to see an additional warning before deleting (or any other action). An easy and effective way to do this is to change the file attributes to Read Only. If you are unsure how to do this, read the tips below.

Steps

Method 1 of 2: The GUI Method

Make a File Read Only Step 1
Make a File Read Only Step 1

Step 1. Right-click on the file whose attributes you want to change to Read Only

Make a File Read Only Step 2
Make a File Read Only Step 2

Step 2. In the context menu, select the Properties tab

Make a File Read Only Step 3
Make a File Read Only Step 3

Step 3. In the "Properties" window that appears, select the "Read only" checkbox in the "Attributes" section of the "General" tab

Make a File Read Only Step 4
Make a File Read Only Step 4

Step 4. Click Apply and then OK

Method 2 of 2: Command Line Method

Make a File Read Only Step 5
Make a File Read Only Step 5

Step 1. Open Command Prompt

It can be opened by clicking on Start-> Run and then typing cmd and pressing Enter. You can also press the key combination Win + R. Step 2. Enter the following commands to make the file read-only.

  • attrib + r ""

  • Example:

    attrib + r "D: \ wikiHow.txt"

    Make a File Read Only Step 6
    Make a File Read Only Step 6

Advice

  • Changing the file attributes to Read Only can help you in many cases.

    • When you try to change the filename, a warning appears.
    • When you try to delete a file, a warning appears.
  • To remove the Read Only attribute from a file:

    • for the GUI method, just uncheck the Read Only checkbox;
    • for the command line method, change the + r command to -r.

      For example:

      attrib -r "D: \ wikiHow.txt"

Popular by topic