I have a windows cmd.exe script that runs a child process and needs to collect the output from the child to set three variables. The child process does some work, and prints out three values.
How do I code the parent to collect the values printed out by child ?
I can make any amendments to the child process needed to do this, but the parent script must be written as a cmd.exe batch file.
Is it acceptable that child process set environment variables? parent process should be able to pick that up.
child.bat
parent.bat
You can set environment variable from child program/script whatever language you are using - there are ways to set environment variables from them.
The answer from
mr.b
happens to be correct is because, both batch script are running in the same cmd.exe process. Actually, child process could not write environment variables of parent process. Try other IPC methods.