How to set env. var from C program (Developers)
I'm trying like idiot and nothing works.
I tried various functions like
int main(void)
{
printf("putenv: %d\n", putenv("TEST1=123"));
printf("sys: %d\n", system("SET TEST2=123"));
...clearenv, setenv
return(0);
}
I can only read env. Funtions returns 0 = success but when I type set or env in shell I don't see new var. I tried DOS, win, linux - all the same. Do I need to call some extra function that flush env. changes to make it persistent? Or other way to do it? Uf going to bed now....
---
DOS gives me freedom to unlimited HW access.
Complete thread:
- How to set env. var from C program - RayeR, 15.01.2013, 04:34 (Developers)
- How to set env. var from C program - Laaca, 15.01.2013, 07:41
- How to set env. var from C program - RayeR, 15.01.2013, 10:31
- How to set env. var from C program - tom, 15.01.2013, 13:54
- How to set env. var from C program - RayeR, 15.01.2013, 14:07
- How to set env. var from C program - tom, 15.01.2013, 15:41
- How to set env. var from C program - marcov, 16.01.2013, 15:19
- How to set env. var from C program - RayeR, 16.01.2013, 23:33
- How to set env. var from C program - RayeR, 15.01.2013, 16:24
- How to set env. var from C program - bocke, 18.01.2013, 16:57
- How to set env. var from C program - RayeR, 15.01.2013, 14:07
- How to set env. var from C program - bretjohn, 15.01.2013, 17:30
- How to set env. var from C program - RayeR, 15.01.2013, 23:51
- How to set env. var from C program - bretjohn, 16.01.2013, 01:05
- How to set env. var from C program - RayeR, 16.01.2013, 03:20
- How to set env. var from C program - bretjohn, 16.01.2013, 17:08
- How to set env. var from C program - RayeR, 16.01.2013, 03:20
- How to set env. var from C program - bretjohn, 16.01.2013, 01:05
- How to set env. var from C program - RayeR, 15.01.2013, 23:51
- How to set env. var from C program - j_hoff, 15.01.2013, 23:57
- How to set env. var from C program - RayeR, 16.01.2013, 00:49
- How to set env. var from C program - roytam, 16.01.2013, 04:57
- How to set env. var from C program - roytam, 16.01.2013, 05:13
- How to set env. var from C program - j_hoff, 16.01.2013, 08:11
- How to set env. var from C program - RayeR, 16.01.2013, 00:49
- How to set env. var from C program - tom, 15.01.2013, 13:54
- How to set env. var from C program - RayeR, 15.01.2013, 10:31
- How to set env. var from C program - georgpotthast, 15.01.2013, 22:20
- How to set env. var from C program - RayeR, 15.01.2013, 23:48
- How to set env. var from C program - Laaca, 15.01.2013, 07:41