At Linux the following technique can be used to auto-remove file at process exiting:
The process creates a file using either open or creat and then immediately calls unlink. The file is not deleted, however, because it is still open. Only when the process either closes the file or terminates, which causes the kernel to close all its open files, is the file deleted.
Is there way to have same result at Windows?
You can pass to
CreateFilethe flagFILE_FLAG_DELETE_ON_CLOSE.