How can I delete a file that is in use by another process?

前端 未结 6 572
野性不改
野性不改 2020-12-10 05:34

When I try to delete a file occurs the following exception:

The process cannot access the file \'\' because it is being used by another process.<

6条回答
  •  有刺的猬
    2020-12-10 06:15

    You can P/Invoke the Windows MoveFileEx function, and use the MOVEFILE_DELAY_UNTIL_REBOOT flag, with a NULL destination name. This will delete the file when you reboot.

提交回复
热议问题