in reply to
Re^3: Get the process id, and output of a process, in a threaded environment
in thread Get the process id, and output of a process, in a threaded environment
That would be a way to go about it. Unfortunately however, I am using a thread pool (as you and I have previously decided would be best solution for the application described in this thread, which has undergone a number of improvements but overall structure is the same), so any option of setting the environment before thread creation is out of the question, as it will need to constantly change on a per command basis.
I'll update my original post to have a more clear description of my script