How to Assign Read Only Status to a File

Table of contents:

How to Assign Read Only Status to a File
How to Assign Read Only Status to a File
Anonim

Have you created a file in which you have entered important information that you do not want to be lost by mistake and for security reasons you want to be notified via a message before it can be renamed or deleted? The solution is simple: make the file read-only by enabling the Read-only attribute. If you don't know how to proceed, read on to find out how.

Steps

Method 1 of 2: Using the Graphical User Interface of the Operating System

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

Step 1. Select the file to which you want to change the Read Only attribute with the right mouse button

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

Step 2. Choose the Properties option from the context menu that appeared

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

Step 3. Select the Read Only check button located within the Attributes section of the "General" tab of the "Properties" window

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

Step 4. At this point, press the Apply and OK buttons in succession

Method 2 of 2: Use the Windows Command Prompt

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

Step 1. Open a Command Prompt window

You can do this by accessing the "Start" menu, choosing the "Run" item, typing the command cmd in the Open field and pressing the Enter key. Alternatively, you can press the Windows + R hotkey combination.

Step 2. To activate the Read Only attribute of the desired file, type the following command in the "Command Prompt" window, then press the "Enter" key

  • attrib + r "[file_path]"

  • Example:

    attrib + r "D: / wikiHow.txt"

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

Advice

  • Changing the attributes of a file to make it uneditable ("Read Only") will help you in several ways.

    • You will be notified with a message when you try to rename the file.
    • You will be notified with a message when you try to delete the file.
  • To remove the Read Only attribute from a file follow these instructions:

    • If you are using the GUI of the operating system, simply uncheck the Read-only checkbox.
    • If you are using the command prompt, use the code given in the relevant method in the article by replacing the + r parameter with -r.

      Example:

      attrib -r "D: / wikiHow.txt"

Recommended: