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.
Related Articles
- Add Take Ownership Option To Files and Folders Context Menu in Vista
- Easier Way to Take Ownership and Grant Access Files or Directories in Vista
- Add “Empty Folder Contents” To Vista Right Click Context Menu To Delete Files Without Removing Folders
- Take and Grant Full Control Permissions and Ownership in Windows 7 or Vista Right Click Menu
- Force Delete (Cannot Delete) Locked or In Used Files or Folders with FileASSASSIN
- How to Take Ownership and Grant Permissions in Windows Vista
- Delete Files or Folders Locked by Windows Via Unlocker 1.8.7
- Show, List Out and Identify All Shared Files and Folders in Windows Vista
- Delete and Remove to Unlock EISA Hidden Recovery or Diagnostic Partition in Vista
- How to Delete and Remove hiberfil.sys Hibernation File in Windows XP and Vista










































December 4th, 2009 00:29
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.
October 28th, 2009 01:28
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
October 23rd, 2009 21:39
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..
..
September 25th, 2009 09:17
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.
September 22nd, 2009 11:52
just use the unlocker extremely easy for the guys hu dun dare to run cmd http://ccollomb.free.fr/unlocker/
August 11th, 2009 09:57
thank you vey much.. whoa!!! your’e a god!! i have deleted those files i cant delete.. once again.. thanks!!
August 3rd, 2009 11:12
works great
June 30th, 2009 01:44
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
May 27th, 2009 14:55
Thanks a lot!
)
February 20th, 2009 05:20
[...] Delete Undeletable Files in Windows Vista (mydigitallife.info) [...]
January 25th, 2009 13:51
it saves lifes in windows 7 too!
))
December 27th, 2008 13:21
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
December 15th, 2008 13:40
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.”
November 30th, 2008 14:31
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.
October 12th, 2008 05:16
[...] 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 [...]
October 11th, 2008 19:43
[...] 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 [...]
October 3rd, 2008 10:09
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.
September 10th, 2008 22:31
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!
September 7th, 2008 00:19
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
August 28th, 2008 19:27
Had exactle the same problems here.
Usually i don’t like to use external programs, but this one helped.
http://ccollomb.free.fr/unlocker/
August 24th, 2008 13:37
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…
August 20th, 2008 11:42
good job!
June 29th, 2008 15:40
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,
May 25th, 2007 16:12
[...] 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 [...]