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

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

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

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

Step 4. Click Apply and then OK
Method 2 of 2: Command Line Method

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