Saturday, October 09, 2010

Windows 7: Unlocking a File

Is there a file you can't delete because some application has it open, below are some suggestions for unlocking a file.  Be aware that some systems files can be locked down by operating system security or can be locked by a system process.
  • Close all open applications.
  • Temporarily disable your anti-malware software.
  • Temporarily disable file sharing.
    • To the available file shares on your system.
      • From the Start menu, right-click Computer and select Manage.
      • Under Systems Tools, expand Shared Folders
      • Expand Shares, from here you can see folders being shared
        • Note: Don't delete any default shares.
    • Turning off file sharing
      • From the Start menu, type "file sharing" in the search field, and then press Enter.
      • Under File and printer sharing, select Turn off file and printer sharing.
      • Under Public Folder Sharing, select Turn off public folder sharing.
      • Press the Save changes button.
  • Temporarily disable file indexing
    • From the search box under the start menu type "Indexing"
  • Use Process Explorer and OpenedFilesView to see if you can identify the application or processing locking the file.
  • Run CHKDSK /R (will require reboot).  This checks the MFT (Master File Table) and make makes sure it's not corrupted.  If there is corruption, it will try to repair it.
  • Reset file permission on the file.  Under certain circumstances file permissions or ownership information can be altered or corrupted.
    • Use caution when using this tip, it requires an understanding of NTFS file permissions and ownership: right-click on the file, select Properties, select the Security tab, press the Advanced button, from here you can try reset file security or file owner.
  • Reboot in Safe Mode.  This will disable all third party and non-essential services.
    • Press F8 before the Windows load screen, then select "Safe Mode"
  • Reboot in System Recovery Command Prompt 
    • Press F8 before the Windows load screen, then select "Repair Your Computer"
    • You will be prompted for selecting a language and keyboard type
    • You will be prompted for a local administrator password
    • Select Command Prompt, from here you should be able to delete just about any file without restriction so be careful.

1 comment:

jay den said...

Long path tool can be helpful on this situation.