Passing data between the parent process and bat/cmd
- From: "Andrew" <anonymous@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Jul 2006 13:32:40 +1200
I have an unmanaged program that can be extended with custom batch scripts.
I use CreateProcess() to execute whatever has been specified by the user.
Most likely, it's a .bat/cmd file.
The user needs to have an easy way to specify several return values in the
batch file, so that these values can be processed by the parent executable.
Environment variables would be an ideal solution. The problem is, the batch
doesn't seem to be able to change the parent's environment variables.
Neither the parent can read the modified environment of the child process.
ERRORLEVEL is not enough, as the batch file needs to return string values.
stdout/stderr redirection is no good either, as the content of the batch
file (say, nested calls to other .bat files) may interfere with the output.
So my question is, what's and easy and effective way to pass several returns
values from a batch file to the parent executable?
Thanks,
Andrew
.
- Follow-Ups:
- Re: Passing data between the parent process and bat/cmd
- From: Andrew
- Re: Passing data between the parent process and bat/cmd
- From: David Wilkinson
- Re: Passing data between the parent process and bat/cmd
- From: Ulrich Eckhardt
- Re: Passing data between the parent process and bat/cmd
- From: Eugene Gershnik
- Re: Passing data between the parent process and bat/cmd
- Prev by Date: Unicode text file read
- Next by Date: Re: two Ethernet cards
- Previous by thread: Unicode text file read
- Next by thread: Re: Passing data between the parent process and bat/cmd
- Index(es):
Relevant Pages
|