[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] 24x7 Script Archive


How to Redirect Standard I/O of a Console Application Using Batch File

Create a batch file, named REDIRECT.BAT, that contains only the following command line:

type stdin.txt | consol.exe > stdout.txt

Substitute console.exe with the name of your application.

Create a new text file using Notepad or any text editor. Enter the desired input text and press the ENTER key. Save the file as "stdin.txt." This file contents will be sent to the standard input of your application by using DOS pipe. The standard output of your application is redirected to the "stdout.txt" file.

Schedule REDIRECT.BAT file to run as a synchronous job or run it by using the RunAndWait statement in a job of 24x7 script type.