Hack Forums
[Tut]How to delete Locked/Undeletable files/folders in Windows Vista/7 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Computing (https://hackforums.net/forumdisplay.php?fid=88)
+---- Forum: Microsoft Windows (https://hackforums.net/forumdisplay.php?fid=347)
+---- Thread: [Tut]How to delete Locked/Undeletable files/folders in Windows Vista/7 (/showthread.php?tid=978746)

Pages: Pages 1 2


[Tut]How to delete Locked/Undeletable files/folders in Windows Vista/7 - J4mmy - Jan 15, 2011

Hello,
I will present you a powerful method to remove locked/undeletable files from your computer that have given you headache and made you frustrated as nothing have worked.

Requirements

The Process of Deletion

Install Unlocker 1.9.0 (If you have not already installed it). Now right-click the locked/undeletable file/folder and click on Unlocker. Now the file should be unlocked (or if it does not contain locks, you will be represent with ability to choose what action you would like to perform with the file.) and now we want to bring up Command Prompt with Administrative Rights.

For this part i will be showing what to do with each, files and folders. Okay so first up is files, click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as Administrator.

Type the following command and press ENTER:


Code
TAKEOWN /F <filename>
(Replace the text <filename> with the full path of the actual file.)

If the operation was successful, you should see the following message:


Code
"SUCCESS: The file (or folder): "filename" now owned by user "Computer Name\User name"."
Then to assign the Administrators group Full Control Permissions for the file, you may use the ICACLS command. Use this syntax:

Code
ICACLS <filename> /grant administrators:F

Now you are able to delete the file that has been giving you headaches and frustration :)

Okay, next up folders. Again open up Command Prompt with administrative rights. Then use the following syntax:


Code
takeown /f <foldername> /r /d y
Then to assign the Administrators group Full Control Permissions for the folder, use this syntax:

Code
icacls <foldername> /grant administrators:F /T
The /T parameter is added so that the operation is carried out through all the sub-directories and files within that folder.

Code
Command-line help: To know more information about the above commands, run these commands from a Command Prompt window.

takeown /?

icacls /?

Now you should be able to delete the folder that was before locked/undeletable.

Source for the explanation of the commands: http://www.winhelponline.com/blog/take-ownership-of-file-or-folder-windows-7-vista/

I hope this helped you out with deleting the files that was not before able to of being deleted! All kind of feedback is appreciated.

Cheers,
J4mmy


* - L.J.Gibbs - Jan 15, 2011

sweet TUT man...now i can delete SYS32 with ease!


* - J4mmy - Jan 19, 2011

(Jan 15, 2011 09:45 PM)RIPLEY11 Wrote:  sweet TUT man...now i can delete SYS32 with ease!

Thank you for the feedback, but i think the sentence after "..." was unecessary.


* - Ankush - Jan 26, 2011

Nice tutorial bro..its very helpful


* - Le Jeu Avant Tout - Jan 26, 2011

Thanks helpful tut bro :)


* - J4mmy - Jan 26, 2011

Thanks for the positive feedback :) If you find out something is missing/something should be added, just post it.

~J4mmy


* - kh3ir0n - Feb 8, 2011

Thanks a lot I will try it! Normally what I do is to insert any live cd that I have around, and delete the file from outside of windows but this is very nice since I don't have to restart twice. Great TUT.


* - J4mmy - Feb 14, 2011

(Feb 8, 2011 09:38 PM)kh3ir0n Wrote:  Thanks a lot I will try it! Normally what I do is to insert any live cd that I have around, and delete the file from outside of windows but this is very nice since I don't have to restart twice. Great TUT.

Thanks for the positive feedback, it's always appreciated!


* - Glοryallowed - Feb 14, 2011

Great tutorial, but there are tools like FileAssassin (From Malwarebytes) that can do it easily too :3


* - J4mmy - Feb 14, 2011

(Feb 14, 2011 03:36 PM)DarkXLord Wrote:  Great tutorial, but there are tools like FileAssassin (From Malwarebytes) that can do it easily too :3

But what if you have a virus that blocks MBAM from starting up? 🤫


* - Glοryallowed - Feb 14, 2011

(Feb 14, 2011 03:39 PM)J4mmy Wrote:  But what if you have a virus that blocks MBAM from starting up? 🤫

FileAssassin isn't linked to MBAM. MBAM is Malwarebytes Anti-Malware process, FileAssassin is another tool :D


* - J4mmy - Feb 14, 2011

(Feb 14, 2011 03:48 PM)DarkXLord Wrote:  FileAssassin isn't linked to MBAM. MBAM is Malwarebytes Anti-Malware process, FileAssassin is another tool :D

BUT, FileAssassin needs to have Malwarebytes open in order to access it, so i guess you lost the game?


* - Glοryallowed - Feb 14, 2011

(Feb 14, 2011 03:52 PM)J4mmy Wrote:  BUT, FileAssassin needs to have Malwarebytes open in order to access it, so i guess you lost the game?

Nah, you lost it :D, FileAssassin is intergrated into malwarebyte, but also available alone :3

Here is a link for you to take a look at it: http://www.malwarebytes.org/fileassassin.php


* - J4mmy - Feb 14, 2011

(Feb 14, 2011 03:58 PM)DarkXLord Wrote:  Nah, you lost it :D, FileAssassin is intergrated into malwarebyte, but also available alone :3

Here is a link for you to take a look at it: http://www.malwarebytes.org/fileassassin.php

God damnit 🤦‍♂ Well better luck for me next time 🤝


* - kalick77 - Feb 14, 2011

great tut bro keep up the good work. =)