I'm trying to set a system variable from a C++ program, the same way SET VARIABLE= will do in dos.
Printable View
I'm trying to set a system variable from a C++ program, the same way SET VARIABLE= will do in dos.
Check out:
SetEnvironmentVariable()
GetEnvironmentVariable()
Regards,
Paul Mckenzie
Paul,
I found Get/SetEnvironmentVariable() are only good while the thread of the program is running - once the program ends, the command level variable settings are reset. Do you have any ideas on how to return/set a command variable (ie. errorlevel) which persist after the c+ program terminates?