Why not just run a service and the whole reason the service would run
is to lock the file. If the file is locked, there is no easy to delete
the file. Of course stopping the service would take out a handle from
the file but you should probably look up some code to see if the
service has been stopped. Just like if you try to kill GoogleUpdater
Service, you will notice that the process comes back in the list in
few mins. If Google can do it, I am sure there is a way to handle the
situation in your case.

-S

On Aug 29, 4:38 am, Marcus <[email protected]> wrote:
> Hello
>
> I need to store a small exe file in memory. I want to do this because
> I want some sabotage protection in my app. If the user removes this
> essential file from the harddrive, my app will not work the next time
> it is to be launched.
>
> So I want to read this exe file into memory initially when my program
> starts up. Then I will use a timer that at some interval checks if
> this file is present on the file system. If not, then my app writes it
> back from memory to the harddrive.
>
> Could someone please give an example how to do this. It should be a
> pretty small piece of could I reccon, but I can not figure it out.
>
> Thanks

Reply via email to