slider-img

Folder Permissions Using Command Line

If you have tried to move or delete a folder, but found that (even as the administrator) you are given an error saying that you don’t have permission to do so, you find yourself running through the tedious process of taking ownership of the folder, and then changing the permissions and having it propagate.  While this isn’t necessarily a difficult task, it can be annoying to run through.

I found myself in a situation where I needed to modify permissions on non-adjacent folders within a directory–so I could not just make the changes to the parent folder and be done.  The process I used was still tedious and time-consuming, I found it was still quicker than modifying the properties of each folder manually using the GUI.

  1. First you need to open an elevated command prompt (right-click the command prompt and select Run As Administrator)
  2. Then change your directory to get where the folders you need to modify reside
  3. Now to take ownership of the folder, run the following command:

takedown /f [foldername] /r /d y

  1. Next, to give the administrators of the system full control/permissions, run this command:

icacls [foldername] /grant administrators:F /T

  1. You can then delete, move, etc. the folder you have modified (either in Windows or also using a del command)

Comments are closed.