unlock file, close handle, kill process that holds it?

S

Sergei Shelukhin

Hi. I am writing an app that updates a certain windows service that is
had previously installed.
It stops the service, rewrites the file, and starts it again.
On some machines, however, even though the service is stopped, I am
getting "being used by another process" error. I wonder if there's any
pre-made class in .NET framework or some third-party component that
would close the handle to this file from whichever process, or kill
offending process altogether; e.g. unlock the file no matter what?

I am contemplating using WinApi to accomplish this, but I think it
might be reinventing the wheel...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top