I have a BAT program that repeatedly calls an EXE (MKS sed.exe) with output redirected to a TXT file. Sometimes termination of execution if this program by its window X button click leaves the EXE process running and the TXT file open for writing, obstructing further access to the TXT file.
Current workaround is: after clicking X, use Task Manager to manual terminate the EXE.
Is there a remedy not requiring replacement of the EXE?
I have no seen this problem from the same file on WinXP.