Hey! We had to figure out how to grab the current environment variables for a running program. Basically, a snapshot of the environment variables is saved for each program when it is first began and all calls to get the environment variables will return the same values no matter whether they've been changed outside the program. I think this harkens back to the days of DOS before multitasking was possible, so each program, being the only program running, expected to have the same environment variables from start to finish, unless it changed them. Then multitasking came along and they needed to support the old programs' way of living... all the way up until now, when Windows Effing XP still has the SAME legacy functionality.
Thanks Micro$haft.
So, the way to get the latest environment variables is to go look in the registry. They're all in there under the key:
Hmmmmmm... grr... I can't remember what key it is. I'll get back to you.
I would LOVE this functionality, and it would actually make it very viable for our office environment.
Cheers,
.Me