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.

Share and contribute or get technical support and help at My Digital Life Forums.



8 Responses to “Delete Undeletable Files in Windows Vista”

  1. 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 [...]

  2. 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,

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

    good job!

  4. 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…

  5. 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/

  6. 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

  7. 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!

  8. 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.

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 without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

can't delete file vista - delete files vista - vista can't delete file - delete files in vista - vista delete files - delete file vista - can't delete file in vista - unable to delete file vista - how to delete files in vista - vista delete file - vista cannot delete file - unable to delete files in vista - can't delete a file vista - windows vista can't delete file - how to delete a file in Vista - can't delete files in Vista - cannot delete file vista - can't delete a file in vista - can't delete files vista - vista unable to delete files - I can't delete a file in Vista - cannot delete files in vista - vista unable to delete file - deleting files on vista - vista can't delete files - delete undeletable files - deleting files in vista - Delete Vista files from XP - deleting files from vista - how to delete file vista - all - delete vista files - remove files vista - vista delete - delete file in vista - windows vista delete files - how to delete files vista - cannot delete a file in vista - delete files from vista - how to delete undeletable files in vista - vista can't delete a file - vista undeletable file - delete in use files vista - unable to delete file in vista - cannot delete file in vista - cannot delete a file vista - deleting undeletable files in Vista - delete file from vista - windows vista cannot delete file - can\'t delete files in vista -