The process cannot access the file because it is being used by another process

前端 未结 10 964
忘了有多久
忘了有多久 2020-11-30 09:38

I have a set of nightly reports.

Sometimes I get the exception:

The process cannot access the file because it is being used by another proce

相关标签:
10条回答
  • 2020-11-30 10:18
    1. Process Explorer > Find > Find Handle > type in your file name.
    2. Unlocker. Try to open it, if it has a lock, unlocker will open and show you the programs that lock it.
    0 讨论(0)
  • 2020-11-30 10:18

    I was trying to start a Java program and got the message. Looking in Task Manager, there was already a Java task running (looping?) when I killed that process, my process was able to run.

    0 讨论(0)
  • 2020-11-30 10:19

    The problem was the MailMessage in .NET was holding on to the file attachments. I had to do a dispose on the attachment and then it worked.

    0 讨论(0)
  • 2020-11-30 10:19

    Use a tool like Process Explorer or Process Monitor.

    0 讨论(0)
  • 2020-11-30 10:20

    here some tool(s) which tells and unlock locked files: http://ccollomb.free.fr/unlocker/

    0 讨论(0)
  • 2020-11-30 10:23

    Filemon might be the tool you are looking for.

    (or even Process Monitor which apparently has replaced FileMon.)

    0 讨论(0)
提交回复
热议问题