Hey, I'm looking for a way to remove the file after you've started it, I've tried via TerminateProcess and then forced ALL_ACCESS (since the file is in use when you run it) and then try remove the file but that doesn't work for the file you're "currently" using.
So how do you remove the file you're currently using (.exe)?
If you can give a example/snippet code, do so.
Also not sure, but might try to help anyway:
If you're talking about deleting a file that the program is using (like a data file being read into the program), there is no way in just C++ to delete files, only to create them.
To delete files you would need to use OS-specific code.