none
Unable to delete a locked file on a Windows 2003 server

    Question

  • Try to delete a file in a Windows 2003 server but it shows "It is being used by another user or program".
    Try look for the user who opens the file but nothing found under Computer Management | Shared Folders | Open Files.
    Able to locate the open file using OpenedFilesView freeware but not able to release the file using the utility.

    Any idea how i can delete the opened/locked file ?

    Thanks in advance.
    Wednesday, April 13, 2011 8:57 AM

Answers

  • Hi.

    I would suggest using Process Explorer. But be careful which processes you kill.

    Start Process Explorer
    Find -> Find Handle or DLL
    Enter name of file, and then search
    Select the file that you want to close, this will select the process holding it open in the main window.
    You can now right click that process terminate it, this will release the file.
    Now you can delete it :)


    Oscar Virot
    • Marked as answer by HKLPG Thursday, April 14, 2011 7:52 AM
    Wednesday, April 13, 2011 9:40 AM

All replies

  • Hi.

    I would suggest using Process Explorer. But be careful which processes you kill.

    Start Process Explorer
    Find -> Find Handle or DLL
    Enter name of file, and then search
    Select the file that you want to close, this will select the process holding it open in the main window.
    You can now right click that process terminate it, this will release the file.
    Now you can delete it :)


    Oscar Virot
    • Marked as answer by HKLPG Thursday, April 14, 2011 7:52 AM
    Wednesday, April 13, 2011 9:40 AM
  • Hi HKLPG,

    If the file is open by someone else, there exist with File handle on the server, and the file cannot be deleted at the mean time. This is normal for Windows Server NTFS system.

    Scorprio


    TechNet Software Assurance Managed Newsgroup | MCTS: Windows Vista | Exchange Server 2007 MCITP: Enterprise Support Technician | Server & Enterprise Administrator | Microsoft Infrastructure Consultant | Solution Architect
    Wednesday, April 13, 2011 9:57 AM
  • Hi.

    I would suggest using Process Explorer. But be careful which processes you kill.

    Start Process Explorer
    Find -> Find Handle or DLL
    Enter name of file, and then search
    Select the file that you want to close, this will select the process holding it open in the main window.
    You can now right click that process terminate it, this will release the file.
    Now you can delete it :)


    Oscar Virot
    Osacr's suggest could be helpful. Please very careful about this action, there may be someone editing on this file. ;)
    TechNet Software Assurance Managed Newsgroup | MCTS: Windows Vista | Exchange Server 2007 MCITP: Enterprise Support Technician | Server & Enterprise Administrator | Microsoft Infrastructure Consultant | Solution Architect
    Wednesday, April 13, 2011 9:59 AM
  • Also the Open Files that you look in only involved if the file is locked over a SMB share. If the file is locked locally use my suggestion and you should be fine.

    *edit as Scorpio said be careful when you release and delete locked files, but I say always be careful when deleting files*


    Oscar Virot
    Wednesday, April 13, 2011 10:00 AM
  • Hi,

    Unlocker Tool is a freeware that will allow you to unlock any files that are currently in use by Windows.

    Brent

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    Thursday, April 14, 2011 1:55 AM
    Moderator
  • Managed to delete the file by closing the file's handle through process explorer (not the process as it is the system process PID #4 that holding it).

    Thanks for the prompt response.

     

    Thursday, April 14, 2011 7:56 AM
  • Thanks !! this helped me as well.
    Tuesday, February 04, 2014 7:17 AM