I have a C program (using MS Visual C++ development toolkit).
The program runs in DOS window on Win XP platform.
I wnat the C program to set and environment variable, so it is available to other DOS batch programs, which run in the same window (called by the C program).
When I use:
system ("echo Hello There"
;
the command workst fine.
When I tried:
system ("set MYENV=test"
;
it did not work. Any idea why?
Conversally, how do I retrieve already set environment variable and display it?
The program runs in DOS window on Win XP platform.
I wnat the C program to set and environment variable, so it is available to other DOS batch programs, which run in the same window (called by the C program).
When I use:
system ("echo Hello There"
the command workst fine.
When I tried:
system ("set MYENV=test"
it did not work. Any idea why?
Conversally, how do I retrieve already set environment variable and display it?