Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I need help with the DOS EXEC function
: I'm running into this problem when I run a *.BAT file from an application I've written. It works fine until I press control-C in the middle of the batch program:
: During the application's execution, I use an EXEC function to call the COMSPEC (COMMAND.COM or CMD.COM) and supply the name of a batch file (LIST.BAT) to list some files. The batch files work as it should as thoughI ran LIST.BAT from the DOS's command prompt. When the batch file ends, I type EXIT and return to my application, no problem.
: It's when I press CONTROL-C while the LIST.BAT file pauses at the end of a full screen that the problem is encountered. When I abort the listing early that way, a file is created in my DOS directory with an arbitrary filename and it's contents are the listing produced by the LIST.BAT file.
: How can I prevent the creation of this file if I want to abort from a batch file using CONTROL-C?