Transforming a file into a Read-only mode serves as a formidable shield against unauthorized alterations or deletions. This definitive guide is your ticket to getting started.
The Procedure
Utilizing the GUI Approach

Simply right-click on the desired file, then select the Read-only option.

Navigate to the Properties tab within the context menu.

Tick the Read-only checkbox under Attributes on the General tab within the opened Properties window.

Apply the changes and then confirm by clicking Okay.
Using Command Prompt

Access the command prompt. You can do this by selecting Start->Run, then typing cmd and pressing Enter. Alternatively, you can use the shortcut Win Key+R.

Input the following commands and press Enter to set your file to Read-only.
attrib +r '<file path=''>'</file>
- For instance:
attrib +r 'D:\Mytour.txt'
Insights
-
Turning a file into Read-only offers numerous advantages.
- It alerts you when an attempt is made to alter its name.
- It warns you when an attempt is made to erase it.
-
To revert a file's Read-only status
- In the GUI method, simply uncheck the Read-only box.
- In the command prompt method, employ the code with -r instead of +r.
For example:attrib -r 'D:\Mytour.txt'