How to Delete Undeletable Files in Windows 7
ADVERTISEMENTS
It has been 2 weeks now to Windows 7 Public beta release and by now everyone is aware of fact that Windows XP to Windows 7 Upgrade is not possible as Microsoft has ditched to Windows XP. But Windows Vista to Windows 7 upgrade is absolutely possible
Even news has surfaced that Microsoft will be soon going to allow free Windows Vista to Windows 7 upgrade for specific class & category of users. However in place upgrade process may or may be successful resulting in corrupted data or some files which are undeletable from windows 7.
Even if you install windows 7 on another partition the old data of previous operating system still present on your hard drive which becomes undeletable or inaccessible from Windows 7.
Usually this problem of undeletable files and folder is because of Access control list of these object is associated with SID of old operating system user accounts and these users are not present in your windows 7, effectively data is owned by nobody or non-existent user.
In order to access the files and folder for manipulation, modification or deletion, we will need to take control of the files under Windows 7. Here are two command line syntaxes to instantly take ownership of such files,
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
Please keep in mind above syntaxes will grant full permission to administrator group hence you must be a part of administrator group to take advantage of above command.
If you are not comfortable with command line then you may read how to guide to take ownership of files manually.















Reader Comments
Thanks!
Worked like a charm.
I have a container file produced by an encryption program when I had XP installed. I have used the above commands which have returned success messages when run but have not allowed me to delete the file even though I own it and have full control of it.
Doesn’t work for me. :-(
C:\Users\Demosthenes>icacls G:\Music\pbtop1000 /grant administrators:F /t
G:\Music\pbtop1000: Access is denied.
Successfully processed 0 files; Failed processing 1 files
C:\Users\Demosthenes>takeown /f G:\Music\pbtop1000 /r /d y
ERROR: The current logged on user does not have ownership privileges on
the file (or folder) “G:\Music\pbtop1000″.
Had a friend who couldn’t delete a file off the desktop. Copied all the files he wanted to another directory. Restarted in safe mode with command prompt. The used dos commands….
cd users
cd username (eg. cd Retro)
cd desktop
I’m now in the following directory..
c:\users\retro\desktop
then type….
del *.*
This will delete everything in the directory :)
Restart windows normally & then copy your desktop items back to your desktop.
Have fun!!!!
Retro :)