# Simply Delete a File or Folder Showing Error “Access Is Denied” using Full Control

**URL:** <https://onehack.st/t/simply-delete-a-file-or-folder-showing-error-access-is-denied-using-full-control/194640>\
**Category:** Tutorials & Methods\
**Tags:** tools, tips-tricks\
**Created:** [July 21, 2021, 11:39pm UTC](https://onehack.st/t/simply-delete-a-file-or-folder-showing-error-access-is-denied-using-full-control/194640 "2021-07-21T23:39:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shayla](https://onehack.st/user_avatar/onehack.st/shayla/32/174870_2.png) [@Shayla](https://onehack.st/u/Shayla)\
**Post date:** [July 21, 2021, 11:39pm UTC](https://onehack.st/t/simply-delete-a-file-or-folder-showing-error-access-is-denied-using-full-control/194640/1 "2021-07-21T23:39:25Z")

</div>

I am not sure why this happens but there is a workaround.

To take control of the folder containing the undeletable create a text file called “delete.bat” and add the following lines to it:

```auto
SET DIRECTORY_NAME="C:\Locked Directory"
TAKEOWN /f %DIRECTORY_NAME% /r /d y
ICACLS %DIRECTORY_NAME% /grant administrators:F /t
ICACLS %DIRECTORY_NAME% /reset /T
PAUSE

```

- You will need to change the directory path to your “Your Desire Want to Delete Directory” folder or file path e.g. “`C:\Locked Directory`” to “`C:\Your Desire Want to Delete Directory`”.

Right click on the file “delete.bat” select “Run As Administrator” and you should now have full control of the directory ✔ and all sub directories meaning you can do what you wish with them.👍

`Source: superuser`

---

<div class="post-metadata">

**Author:** ![Garres\_Tampus](https://onehack.st/user_avatar/onehack.st/garres_tampus/32/76182_2.png) [@Garres\_Tampus](https://onehack.st/u/Garres_Tampus)\
**Post date:** [July 24, 2021, 7:49am UTC](https://onehack.st/t/simply-delete-a-file-or-folder-showing-error-access-is-denied-using-full-control/194640/3 "2021-07-24T07:49:51Z")

</div>

I guess [Unlocker](https://filehippo.com/download_unlocker/) does the same thing

---

<div class="post-metadata">

**Author:** ![Shayla](https://onehack.st/user_avatar/onehack.st/shayla/32/174870_2.png) [@Shayla](https://onehack.st/u/Shayla)\
**Post date:** [July 24, 2021, 7:20pm UTC](https://onehack.st/t/simply-delete-a-file-or-folder-showing-error-access-is-denied-using-full-control/194640/4 "2021-07-24T19:20:11Z")

</div>

Unblocker won’t work for such permission case! That’s why this script is needed to gain full access!
