Delete Undeletable Files in Windows Vista

There are files and directories in Windows Vista that seem to impossible to delete and remove away. These persistent undeletable files and folders sometimes can’t even be accessed no matter what, even by an administrator, and you’re pretty sure that the files are not locked by running process. This situation always happen especially if you perform in-place upgrade from Windows XP or install Windows Vista on another partition or hard disk drive, leaving the old XP used partition with its own data.

The problem symptom occurs because the undeletable files and folders’ ACLs (Access Control Lists) were set for accounts with SIDs that applied to an old partition. So these data will effectively owned by nobody or non-existent user when view in Vista operating system. In order to access the file for manipulation, modification or deletion, we will need to take control of the files under Vista.

We can use 2 command-line utilities to take ownership of the files or folders, and then grant full control access permissions to Administrators group, which supposedly you’re a member of. The 2 command line syntaxes are as below. Note that the full path should be included if you’re not at the current directory, and to run these commands, command prompt has to be in elevated mode.

For Files:

takeown /f file_name /d y
icacls file_name /grant administrators:F

For Directories (will perform action recursively):

takeown /f directory_name /r /d y
icacls directory_name /grant administrators:F /t

You can also prepared a Windows shell batch script that automate the process for easy take back the files and folders which is inaccessible and undeletable.

If you’re not comfortable working with command line, you can also using Windows Explorer to do the task. But be warned that it’s a lengthy process, as detailed in how to take ownership and grant permissions guide.

This article has been reposted to Tip and Trick.

24 Responses to “Delete Undeletable Files in Windows Vista”

  1. DMG
    December 4th, 2009 00:29
    24

    I have this problem after downloading a set of files from a file server.

    takeown fails for every, giving “INFO: Access is denied” errors.

    icacls fails after the very first file, outputting “Access is denied” and giving up on any subsequent files.

  2. William Wilson
    October 28th, 2009 01:28
    23

    This for me was a life safer also. Not sure why MicroSoft makes our lives so hard.

    Thanks a million is not even good enough
    Bill

  3. bobby
    October 23rd, 2009 21:39
    22

    This method worked for me..Care should be taken not to close the task manager till end… Kill process explorer.exe in task manager, then give cmd in new task to get command prompt running, go to desired file and delete the file. Now that the file is deleted, explorer should be given in New task in task manager to come back to the initial stage with file deleted.. :) ..

  4. DL
    September 25th, 2009 09:17
    21

    I followed the instructions but still could not delete the directory. It was created by Maxtor’s ont-touch back up system under Windows XP. I now run Windows VISTA. It appeared that there was a file called “Thumbs.db” in a subdirectory that would not delete.

    In the end, I moved my drive back to my old XP Machine. Initially it would not delete. Then I used the “cut” instruction, followed by delete, and the file went away – finally!!

    I hope this helps someone else.

  5. worlddlck
    September 22nd, 2009 11:52
    20

    just use the unlocker extremely easy for the guys hu dun dare to run cmd http://ccollomb.free.fr/unlocker/

  6. chester
    August 11th, 2009 09:57
    19

    thank you vey much.. whoa!!! your’e a god!! i have deleted those files i cant delete.. once again.. thanks!!

  7. A
    August 3rd, 2009 11:12
    18

    works great

  8. Gunjan
    June 30th, 2009 01:44
    17

    THANK U IT WORKED
    Vista is painful, but some how 4 GB is free.
    NOTE : Replace by your username: like I replaced it by in the Command 2

    takeown /f directory_name /r /d y
    icacls directory_name /grant Gunjan:F /t

    Thanks

  9. RedFish
    May 27th, 2009 14:55
    16

    Thanks a lot! :o )

  10. Delete Undeletable Files in Windows
    February 20th, 2009 05:20
    15

    [...] Delete Undeletable Files in Windows Vista (mydigitallife.info) [...]

  11. Ariel
    January 25th, 2009 13:51
    14

    it saves lifes in windows 7 too! :) ))

  12. Mohammed
    December 27th, 2008 13:21
    13

    I tried the method you mentioned to delete a file that does not want to get deleted. but I always get the message “file no longer located in **** verify and try again”. I even tried doing it in safe mode nothing.

    any other suggestions

  13. Tim
    December 15th, 2008 13:40
    12

    It worked amazingly.

    I was stuck until I saw Rob:
    “Make sure you check the task manager to be sure the file isnt running before trying to delete it. If it is, there is no way to delete it till u stop the process.”

  14. Emma
    November 30th, 2008 14:31
    11

    I’ve tried the command prompt method AND rebooting in safe mode to delete my windows.old files and it STILL isn’t working. Any suggestions?
    Thanks in advance.

  15. WindowsObserver.com » Windows Vista Google Alerts for 11 October 2008
    October 12th, 2008 05:16
    10

    [...] Comment on Delete Undeletable Files in Windows Vista by Vista … By Vista – Unable to delete folder – The Prophecy… this through Google How to Delete a System File in Windows Vista :: the How-To Geek Delete Undeletable Files in Windows Vista My Digital Life Vista: Remove Old XP Files after Upgrade (Windows.old) | Microsoft Vista | Tech-Recipes [...] Comments for My Digital Life – http://www.mydigitallife.info [...]

  16. Vista - Unable to delete folder - The Prophecy Forums
    October 11th, 2008 19:43
    9

    [...] this through Google How to Delete a System File in Windows Vista :: the How-To Geek Delete Undeletable Files in Windows Vista My Digital Life Vista: Remove Old XP Files after Upgrade (Windows.old) | Microsoft Vista | Tech-Recipes [...]

  17. Rob
    October 3rd, 2008 10:09
    8

    Make sure you check the task manager to be sure the file isnt running before trying to delete it. If it is, there is no way to delete it till u stop the process.

  18. ArneOst
    September 10th, 2008 22:31
    7

    Couldn’t delete the files either after this process, so changed the value “administrators” to my local username “Arne” and it worked!

    like:
    takeown /f “Program Files” /r /d y
    icacls “Program Files” /grant Arne:F /t”

    Thx, finally some space!

  19. Peter McCarthy
    September 7th, 2008 00:19
    6

    Well… thank you very much!

    I’ve been trying to free up room on my 2nd drive that had an older Vista installation on it for quite a while. Your command prompt advice worked perfectly.

    Take the rest of the day off!

    Peter

  20. Marcel
    August 28th, 2008 19:27
    5

    Had exactle the same problems here.

    Usually i don’t like to use external programs, but this one helped.

    http://ccollomb.free.fr/unlocker/

  21. Kinryuu
    August 24th, 2008 13:37
    4

    This doesn’t seem to do any good on my Vista Ultimate system. Sometimes there are files that I simply cannot delete, even after having ownership and running the icacls command.

    I have no idea what’s causing it. Sometimes, I can leave the file alone and come back to it later and it will delete just fine. Other times, it simply will not delete without unmounting and remounting the entire drive.

    Oddly enough, the files don’t show up anywhere in any handles (checked via process explorer) AND I can even rename the files successfully, which would imply that the files are not locked. And yes, the files still won’t delete even after renaming.

    There is something strange afoot with Vista files… not sure what…

  22. Pichy
    August 20th, 2008 11:42
    3

    good job!

  23. abell
    June 29th, 2008 15:40
    2

    I still cannot delete my camtasia folders on my desktop using your instructions or these instructions. They only helped me remove a couple JPG files I been try’in to get rid of. CAN SOMEONE PLEASE HELP ME!

    Regards,

  24. How to Take Ownership and Grant Permissions in Windows Vista » My Digital Life
    May 25th, 2007 16:12
    1

    [...] possible to take ownership and grant full control permissions from command line. Or you can also prepare a Windows shell batch script that easily perform the task by typing simple [...]

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.

New Articles

Incoming Search Terms for the Article

Can't delete file vista - force delete vista - vista can't delete file - can't delete a file in Vista - cannot delete file vista - deleting vista files - vista cannot delete file - can't delete file in vista - cant delete file vista - how to delete files in vista - delete files vista - unable to delete file in vista - delete undeletable files vista - how to delete undeletable files vista - cannot delete files in vista? - how to delete files that won't delete vista - unable to delete file vista - undeletable files vista - unable to delete files in vista - file deleter for vista - how to delete protected files in vista - windows vista unable to delete file - delete files in vista - vista force delete - cant delete a file in vista - delete vista files - file won't delete vista - how to delete a file that won't delete in vista - cant delete file in vista - deleting files in vista - how to force delete a file in vista - I can't delete a file in Vista - vista cannot delete files - deleting undeletable files vista - how to delete files vista - vista cannot remove file - windows vista force delete file - vista file deleter - how do you delete windows vista - How to delete Program files in vista - how to delete undeletable files in windows vista - windows 7 unable to delete file - cannot delete file in Vista - can't delete files on vista - how do i delete a file in ms vista - vista cant delete file - delete windows files vista - Deleting Windows Vista Files - delete windows vista system file - file not deleting vista -