cncst@unix.cis.pitt.edu (Christophe N. Christoff) (09/01/90)
I remember before a question was asked about how to delete a subdirectory in a batch file without stopping. This case can be solved well by ECHO Y | del subdir.name Now my question is that I want copy a file to COM1 and I do not want batch file to stop. Since COM1 is not ready, DOS will pop up something like Device not ready Abort, Retry, or Ignore........ I certainly want to abort it in the batch file. But I cannot pipeline it as shown in the way to delete subdirectory. The following is a little background for this. I am writing a program to collect data from COM1 using Turbo Pascal v5.5. For some unkown reason, whenever I turn on the PC, I have some magic letters in COM1. Since the interface to COM1 is not written by me, and I also do not fully understand the interface part, I cannot strip these extra letters away. In the case, my interface part just waiting forever. I have to reboot the machine. If the COM1 buffer can be emptied, my program works fine. So, while I am looking for a way to strip away these extra letters, I can empty the buffer by other programs. I tried several other programs, but they all require user input, this obviously has nothing to do with my program. While by mistake, I found out that copy a file to COM1 can also slove my problem. But the problem is still that I have to type an "a" to abort the copy process since the device is never ready when I turn on the machine (also because those strange letters). Thus, I put a line in the batch file copy autoexec.bat com1 When DOS comes to this line, DOS stops to ask me the input. How can I avoid this? If this cannot be done, how can I write a small program to empty the communication buffer?