HOWTO: Redirect Standard I/O of a Console App Using Batch FileLast reviewed: November 10, 1997Article ID: Q150767 |
The information in this article applies to:
SUMMARYA 32-bit Visual Basic application launches another Win32 process by using either the Visual Basic Shell command or the CreateProcess Win32 API. If the new process is a console application that reads its input from the standard input (STDIN) or writes its results to the standard output (STDOUT), you can redirect its input and output from the parent Visual Basic application. This article describes how to use a batch file (.BAT) to redirect the standard input and output of the spawned console process. To build the sample code in this article, you need the 32-bit edition of Visual Basic and any development tools, such as Visual C++ version 2.0 and above, that build Win32 console applications.
MORE INFORMATIONAfter the parent Visual Basic application spawns the child console process, the parent Visual Basic application provides input to the child's STDIN and receives the output from the child's STDOUT. By using a batch file, the parent Visual Basic application provides the child's STDIN through a disk file and collects the child's STDOUT through another disk file.
Step-by-Step Example
Keywords : PrgOther vb432 VB4WIN kbhowto Version : 4.0 Platform : NT WINDOWS |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |