Deleting a .exe file which is running

> Otherwise how one can delete a file legally if it is in use.

I just wonder if modifying every page of the target process may be of help here…

The thing is, all pages that are backed up by executable section are given copy-on-write protection, for understandable reasons - otherwise, any modification of a program would result in change of on-disk file.
Therefore, by trying to modify a page, you will dissociate it from a section - from now on a page in question will be backed up by pagefile. If you do it for every page, then you will dissociate the whole process from executable section…

Although I do see quite a few potential issues with this approach, it could be a good fun to try it just for the sake of experiment and see what happens…

Anton Bassov