Introduction
A significant feature in the Windows family is to protect a file or folder. We can also use this feature in Windows 10 to protect a file or folder, this is a very useful feature to safeguard our documents from fraudsters.
If we have many more important secret documents in our laptop and by chance, we have to share our laptop with another person and we do not want to share our documents with him/her then we can protect our documents by using various options like by changing the permission of a file or a folder, using command prompt (Cmd), and any third-party software.
This tutorial will show you various ways on, how to protect your files and folders in Windows 10.
Method 1. By Changing the Permission of Files and Folders
By changing the permissions of a file and folder, users can safeguard their documents. Follow the instructions below to proceed.
Step 1
Navigate to a file or folder which you want to protect.
Step 2
Right-click on it and click on the "Properties" option.
Step 3
"Properties" Window will appear on the screen and click on the "Security" tab.
Step 4
Click on the "Edit" button.
Step 5
"Permissions" window will appear on the screen then, select the "Group or user name" and select the "Read" and "Write" Deny option. Click on the "Apply" button to proceed.
Step 6
"Windows Security" windows will appear on the screen and click on the "Yes" button.
Step 7
Now, if anyone tries to open this locked file or folder, he/she will get the "Access Denied Error" dialog box on the screen.
Method 2. Changing the File Format and Extension
Step 1
Navigate to the folder which you want to hide or protect.
Step 2
Right-click on it and click on "Send to > Compressed (Zipped) Folder".
Step 3
Right-click on it and change the name of the zip file with its extension to something else by rename option.
Step 4
Delete the original folder.
Method 3. Create a New Drive (Partition) and Hide it
Follow the instructions below to proceed.
Step 1
First, create a new hard drive by shrinking the already existing hard drive (volume).
Step 2
Then, hide the newly created hard drive (volume).
Note:-
Method 4. Using Command Prompt (Cmd)
With the help of command prompt, users can protect their files and folders. Follow the below instructions to proceed.
Step 1
From the Start menu, open the Run dialog box or you can Press the "Window + R" key to open the RUN window.
Step 2
Type "cmd" and click on the "OK" button.
Step 3
To lock a file or a folder, type the command given below into the command prompt and press the enter key.
cacls <File or Folder Path> /P everyone:n
For example: To lock the "NoidaChapter-C#Corner" folder, run the command as,
cacls O:\NoidaChapter-C#Corner /P everyone:n, where n represents the user's access right to none.
Note:-
After locking the file or folder using the command prompt (cmd), when you just want to open the file or folder it shows the warning message as below.
Conclusion
By following any of the above methods, you can protect your files and folders in Windows 10.
I hope you enjoyed this article. Follow C# Corner to learn more new and amazing things about Windows 10.
Thanks for reading this article.