GetEnvironmentvariables
-
Hi, How can i get the value of Environment variables(user variables)..thru a sample .... Please help me out....
TCHAR varValue[32767];
GetEnvironmentVariable(_T("PATH"), varValue, 32767);varValue
will (after the call) contain the path for your account.Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
TCHAR varValue[32767];
GetEnvironmentVariable(_T("PATH"), varValue, 32767);varValue
will (after the call) contain the path for your account.Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Thanks for ur reply...suppose using this... TCHAR varValue[32767]; GetEnvironmentVariable(_T("TEMP"), varValue, 32767); if get the path of TEMP in varValue...how can i create a folder named "Testing" under that TEMP folder...using CreateDirectoryW()
Here is another way to do it...
//Get the env variable
CString directory = "";
directory = getenv ( "ProgramFiles");//Create a new folder underneath the program files directory
CString newDirectory(directory + "\\EnvFolder" );
BOOL createDirEnv = CreateDirectory(newDirectory, NULL); -
Thanks for ur reply...suppose using this... TCHAR varValue[32767]; GetEnvironmentVariable(_T("TEMP"), varValue, 32767); if get the path of TEMP in varValue...how can i create a folder named "Testing" under that TEMP folder...using CreateDirectoryW()
wchar_t varValue[32767];
GetEnvironmentVariableW(L"TEMP", varValue, 32767);
wchar_t testingDir[32767];
PathCombineW(testingDir, varValue, "Testing");
CreateDirectoryW(testingDir, 0);Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p