I have a batch file that loops every second checking existence of a file. If it exists, bat calls another executable to format and send the contents over serial port and deletes the file afterwards. The problem is that the user must press a button on the linked hardware after the transfer is done, but there is no progress report on either side.
It appears that the sending is called synchronously (theSoft.exe send commandFile.dat
) unless the executable spawns another thread itself.
I decided I could modify the bat to open a window (probably an instance of cmd) and print "Transferring data, please wait" before starting the sending. After the sending is complete it should print "Sending done", leave it up for a second or two and close the window afterwards. But this seems quite hard in windows. I can easily spawn a new window of cmd using start
and echo a text. But the window seems "lost" in the very next moment - how could I refer to the same window after some other lines are done and send additional commands to it (echo another text, wait a bit and close)?
Note: I am not the developer of this setup, the inner workings of most components are out of my reach. The only options seems to be modifying this bat or sniffing the serial port for traffic which seems to involve a lot more work.