How to Deny Folder Permissions Using Command Prompt

Using Command Prompt in Windows
Share on facebook
Share on twitter
Share on linkedin
Share on facebook

With the increase in technology, the use of computers has become a necessity. We store a lot of personal information on our computers, from our favorite photos and media files to official documents. It’s no surprise that we care a lot about our privacy. We want to ensure that our personal data stored in folders on our desktops are protected and not accessible to others.

There are various methods to secure our personal data stored in folders, such as password protection and the option to hide folders.

However, these methods are not entirely secure and can be easily bypassed by hackers.

To ensure maximum security, we can use the command prompt to deny folder permissions.

folder lock

Here’s A Trick To Deny All Permissions Of A Folder Using Command Prompt (CMD)

Using the command prompt, we can deny all permissions to a folder, preventing others from opening or deleting the folder.

Here’s how you can do it:

Step 1: Open Windows Command Prompt

Step 2: Change the directory to the target folder you want to deny access to

Step 3: Type “cacls folder_name /e /p everyone:n” and press Enter

Congratulations!

You have successfully denied all permissions to the selected folder. No one will be able to access or modify the folder, including yourself.

To regain permission, type “cacls folder_name /e /p everyone:f” and press Enter.

Understanding The Commands:

  • cd – Change Directory
  • cacls – Change Access Control Lists
  • /e – edit
  • /p – permissions
  • everyone – every user
  • f – full
  • n – none

The above method is useful when we want to deny access to a particular folder permanently.

But what if we want to deny access temporarily? We can use the command prompt to remove folder permissions.

To remove folder permissions using the command line, follow these steps:

Step 1: Open Windows Command Prompt

Step 2: Change the directory to the target folder you want to remove permissions from

Step 3: Type “icacls folder_name /remove username” and press Enter

This command will remove the folder permissions for the specified user.

If you want to remove folder permissions for everyone, use “icacls folder_name /remove everyone” instead of “username.”

In some cases, we may want to restrict folder access for a particular user.

We can use the command prompt to revoke folder permission for a specific user.

Here’s how to do it:

Step 1: Open Windows Command Prompt

Step 2: Change the directory to the target folder you want to restrict access to

Step 3: Type “icacls folder_name /deny username:(X)” and press Enter

The above command will deny the specified user access to the folder.

If you want to revoke access for everyone, use “icacls folder_name /deny everyone:(X)” instead of “username.” Here, (X) represents the type of permission you want to deny.

For example, to deny write permission, use (W).

In some cases, we may want to prevent users from accessing a particular folder altogether.

We can use the command prompt to disable folder permission for everyone.

Here’s how to do it:

Step 1: Open Windows Command Prompt

Step 2: Change the directory to the target folder you want to disable access to

Step 3: Type “icacls folder_name /deny everyone:(X)” and press Enter

The above command will deny everyone access to the folder, including you. To regain permission, use “icacls folder_name /grant username:(X)” and press Enter.

Here, (X) represents the type of permission you want to grant.

Here is a simple example:

  • There is a folder in E: drive named “Personal

hide folder cmd

  • Open the command prompt and type E: to change the directory to E drive.

WhatsApp Hidden Tricks

cmd change directory

  • Now type cacls Personal /e /p everyone:n

How to Improve Wi-Fi Signal Strength on your Smartphone

directory succesful

  • You will get a command- processed dir: E:Personal
  • Now click on the “Personal” folder.

no access folder

  • You’ll get a popup saying you don’t currently have permission to access this folder.
  • If you click on Continue.

denied permission folder

  • Now you can’t open this folder, can’t delete/copy/move/rename. Your content will be safe!
  • To Regain Permission ” type cacls Personal /e /p everyone:f

regain permission

  • Now you can open this folder.

personal folder

Understanding The Commands:

  • cd- Change Directory
  • cacls- Change Access Control Lists
  • /e- edit
  • /p- permissions
  • everyone- every user
  • f-full
  • n-none

You can use this trick on a pen drive too.

But your pen drive must have NTFS File System. If your pen drive has FAT/FAT32 file system, you can convert it to NTFS.

How To Fix/Repair A Corrupted SD Card Or USB Flash Drive?

  • Plug your pen drive
  • Click on Format
  • Choose NTFS file system, and Format.

ntfs pendrive

Now that you have learned how to use the command prompt to deny folder permissions, let’s explore some additional ways to manage folder access using the command line.

How to Remove Folder Permissions Command Line

If you have previously granted permissions to a folder and want to remove them, you can do so using the command line. Simply open the command prompt and navigate to the folder you want to modify. Then, type the following command:

icacls “foldername” /remove “username”

Replace “foldername” with the name of the folder you want to remove permissions from and “username” with the name of the user you want to remove permissions for. This will remove all permissions previously granted to that user for the specified folder.

Deny Write Permission Command Line

If you want to deny write permission to a folder for a specific user, you can use the following command:

icacls “foldername” /deny “username”:(w)

Again, replace “foldername” with the name of the folder and “username” with the name of the user you want to deny write permission for.

How to Restrict Folder Access Command Prompt

If you want to restrict access to a folder, you can do so using the command prompt.

First, navigate to the folder in question using the command prompt. Then, type the following command:

icacls “foldername” /deny “username”:(r)

This will deny read access to the specified user for the specified folder.

How to Revoke Folder Permission Using Command Prompt

If you want to revoke all permissions for a specific user for a particular folder, you can use the following command:

icacls “foldername” /remove “username”

This will remove all permissions previously granted to that user for the specified folder.

How to Disable Folder Permission Using Command Prompt

If you want to completely disable all permissions for a specific folder, you can use the following command:

icacls “foldername” /deny “username”:(d)

This will deny all access to the specified user for the specified folder.

Prevent Folder Access From Command Line

To prevent folder access using the command line, you can use the following command:

icacls “foldername” /deny “username”:(rx)

This will deny both read and execute access to the specified user for the specified folder.

Command Prompt Restrict Folder Permission

To restrict folder permissions using the command prompt, you can use the following command:

icacls “foldername” /deny “username”:(w)

This will deny write access to the specified user for the specified folder.

Command Line to Deny Folder Access

To deny folder access using the command line, you can use the following command:

icacls “foldername” /deny “username”:(rd)

This will deny both read and delete access to the specified user for the specified folder.

Command Prompt Folder Permission Denied

If you receive a “folder permission denied” error when trying to access a folder, it means you do not have the necessary permissions to access that folder. To grant yourself permission, you can use the following command:

icacls “foldername” /grant “username”:(f)

This will grant full access to the specified user for the specified folder.

Folder Permission Denied Using Command Prompt

If you receive a “folder permission denied” error when trying to access a folder, you can use the above command to grant yourself access to the folder using the command prompt.

How to Grant Folder Permission Using Command Prompt

To grant folder permission using the command prompt, you can use the following command:

icacls “foldername” /grant “username”:(permissions)

Replace “permissions” with the level of access you want to grant the specified user for the specified folder (read, write, execute, etc.).

How to Remove Folder Permissions Using Command Line

If you have previously set folder permissions using the command line and want to remove them, you can easily do so. Follow the steps below to remove folder permissions using command line:

  1. Open Command Prompt: Press the Windows Key + R to open the Run dialog box. Type “cmd” and click “OK” or press “Enter.”
  2. Navigate to the folder location: Use the “cd” command to navigate to the folder location where you want to remove the permissions.
  3. Remove permissions: Type “icacls folder_name /reset” to remove all permissions from the folder.
  4. Press “Enter” to execute the command.

Once you’ve executed this command, all folder permissions will be removed, and no one will be able to access the folder until you grant them permission again.

How to Lock a Folder Using Command Prompt

If you want to lock a folder on your computer to prevent anyone from accessing it, you can use the command prompt to do so. Here’s how:

  1. Open Command Prompt: Press the Windows Key + R to open the Run dialog box. Type “cmd” and click “OK” or press “Enter.”
  2. Navigate to the folder location: Use the “cd” command to navigate to the folder location that you want to lock.
  3. Lock the folder: Type “cacls folder_name /e /p everyone:n” to deny all permissions to the folder.
  4. Press “Enter” to execute the command.

Once you’ve executed this command, the folder will be locked, and no one will be able to access it until you unlock it again. To unlock the folder, follow the same steps above, but use “cacls folder_name /e /p everyone:f” instead.

In conclusion, denying folder permissions using a command prompt is an effective way to protect your personal data from prying eyes. It is easy to use and can be done quickly with just a few simple commands. Whether you want to lock a folder or remove permissions, the command prompt provides a powerful tool to keep your data safe and secure. Just make sure to use it responsibly and only on folders that you want to keep private.

Now there is no need to worry about your private information stored in your personal folders.

Isn’t this hack amazing?

Share this information with your friends and comment below if you know any hacks.