Skip to main content

How to restrict access to files/folders using cmd

Hello friends! You might have many software on the internet which is used to lock the files and folders. Also you might have seen batch programs that also does the same job. Today I am going to tell you a basic cmd command that can be used to restrict access to files and folders. You must have administrative access for doing this.

Follow these simple steps for locking the folder:
1. Open command prompt in windows.
2. Type: cacls "<path>" /e /p everyone:n
cacls is the command that is used to display or modify access control list (ACL) of a file.
Dont forget to write path in double quotes (" ").

for example: cacls ".\New folder" /e /p everyone:n
You can know more about permissions by writing cacls in command prompt and hit enter. You will get details of all the arguments and permissions.
After the command ran successfully,it will give a message that the directory or file has been processed.

3. Now if you try to open such restricted files or folders then you will get "Access denied" message.

4. Wow! You have successfully locked your files and folders.

Follow these steps to unlock Folder/File:

Unlocking the files and folders is similar to the locking. Instead of giving none access (:n), we have to give full access (:f). Rest things are same.

cacls "<path>" /e /p everyone:f

In this way, you will be able to successfully unlock the files and folders.


Popular posts from this blog

Open websites using command prompt

Have you ever tried to open websites through command prompt in Windows......Yes it is possible to open a website through command prompt. There are many ways which i will discuss today....


Today we are gonna talk about Veil-Catapult.Veil-Catapult is payload delivery for when metasploit’s psexec getting caught by AV.It utilizes Veil-Evasion to generate AV-evading binaries, impacket to upload/host the binaries, and the passing-the-hash toolkit to trigger execution.It officially supported on kali linux only.I`m going to show you how to install Veil-Catapult in backtrack?