Initially, you need to know whether the file is open or not. One way of doing this is to use the CreateFile API with the exclusive access flag set. If you get a valid file handle, the file is closed otherwise the file is open.
Personally, I wouldn't seek to close the process which has the file open, I would wait until the file is closed and then update.
Take Care
Matt
If at first you don't succeed, skydiving is not for you.