Mirror Image

Mostly AR and Stuff

Deleting files which couldn’t be deleted by Administrator in Win 7

If you are an unfortunate person who have to use Windows 7 a lot (like me) undeletable files happen to you from time to time. It could be result of disk failure, or interrupted boot, or just for no reason at all.
The problem is, sometimes they can’t be deleted even by Administrator. To fix this Administrator have have to “take ownership” of the file in question.
It goes like this:
1. run from the command line
chkdsk /f
This step is necessary because file permissions could be corrupted
2. login as Administrator.
3. from the command line
takeown /f full_directory_and_path_name
4. from the command line
icacls full_directory_and_path_name /GRANT ADMINISTRATORS:F
5.Now Administrator can delete file. If even that is not helping you can try delete from Safe mode.

Advertisements

1, March, 2012 Posted by | Coding | Comments Off on Deleting files which couldn’t be deleted by Administrator in Win 7