MVV wrote:
Unfortunately it is impossible. Environment may only be inherited by child processes, but there is no legal way to pass something back to parent process (it would be a security hole).
I think I misled you by my use of the word Parent. I used that word because several times you and others have used the word Child. That is, the process that AskParam starts up from <command to execute> was referred to as a Child process. (Some of the usage came from Google Translations of your Russian Forum topic. Let's blame Google Translate
). In this context, the process AskParam runs in is the Parent process. That's why I use that word.
What I want is that the environment variables should be available to the SAME process that AskParam runs in. So, if one considers only the process that AskParam was invoked from, the user entered variables should be available to the SAME batch file that invoked AskParam. So when AskParam runs, it reads the user data, sets the new environment variables for the batch process, and returns. Then since this is the same process, the new variables are available to the rest of the batch program.
======
I am assuming that the batch process is the same process that AskParam runs in. I am thinking it does something like a CALL to AskParam, and AskParam returns. If I am wrong, and AskParam runs in a separate process than the batch file that invoked it, then you are perfectly right about the parent / child problem. It kind of centers around what happens when AskParam is invoked (separate process or same process). And does AskParam simply exit, or does it do a Return?
======
If it is the case that AskParam runs in a separate process, then I agree with everything you have said. Then, your multiple entry schemes make sense. Also, using a temporary file would make sense.
Since you obviously are light years ahead of me, I'll bet AskParam runs in its own process, and I did not realize that?
My hero, Mr. Ghisler. License #37856 since 1999.