how to set environment variables
To change the environment variables in system we need to go to properties ,in properties we need to go to advanced and in that we are changing environment variables.But I want to change the envoironment variables in my system through vc++ program.so can you please tell me the way to do that.
I am doing in this way
DWORD dwRet, dwErr;
LPTSTR pszOldVal,ss;
BOOL fExist;
int BUFSIZE=70;
pszOldVal = (LPTSTR) malloc(BUFSIZE*sizeof(TCHAR));
dwRet = GetEnvironmentVariable(TEXT("IT_CONFIG_PATH"), pszOldVal, BUFSIZE);
if ( SetEnvironmentVariable(TEXT("IT_CONFIG_PATH"), TEXT("config1")))
{
ss="SetEnvironmentVariable success";
return TRUE;
}
but problem is i am getting the environment variable but i am unable to set environment variable to some value. above I tried to set to config1 but when i went to command prompt and giving the command env it's showing previous environment only. so can you please suggest me please..

