China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 11:11
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » [Help] How can I change environment variables with C? View 760 Replies 0
Original Poster Posted 2004-06-24 00:00 ·  中国 上海 联通
初级用户
Credits 105
Posts 1
Joined 2004-06-24 00:00
22-year member
UID 27265
Gender Male
Status Offline
I'm using VC, and I found several functions that can change environment variables, but they can only change the environment variables within the current thread.
But what I want is to change the whole console's environment variables, like this:

set PARA=1
add.exe PARA ; add.exe is a program written in C, and it can add one to the following parameter
echo %PARA%

What I hope to see displayed is 2

Could the experts teach me a way? Many thanks!
Forum Jump: