How to delete a locked file ? - Programmer

This is a discussion on How to delete a locked file ? - Programmer ; Hi, I would like to know if there is any way I can forcefully delete a file locked by another process on Windows. DeleteFile returns me error code 32 (Process cannot access the file because it is being used by ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to delete a locked file ?

  1. How to delete a locked file ?

    Hi,

    I would like to know if there is any way I can forcefully delete a
    file locked by another process on Windows.

    DeleteFile returns me error code 32 (Process cannot access the file
    because it is being used by another process)

    Thanks in advance.

    Regards,
    Ganesh


  2. Re: How to delete a locked file ?

    if the file is "in use" you have two options.

    1) Figure out which program has it open, and terminate the process & delete the
    file.

    2) Use the MoveFileEx() api which can delete the file when the system reboots.




    On 8 May 2007 03:43:43 -0700, ganesh.tambat@gmail.com wrote:

    >Hi,
    >
    >I would like to know if there is any way I can forcefully delete a
    >file locked by another process on Windows.
    >
    >DeleteFile returns me error code 32 (Process cannot access the file
    >because it is being used by another process)
    >
    >Thanks in advance.
    >
    >Regards,
    >Ganesh



+ Reply to Thread