int
main()
{
wchar_t
buffer
[MAX_PATH];
DWORD code
=
GetEnvironmentVariable(L
"WINDIR"
,
buffer
, MAX_PATH);
std::wcout << L
"WINDIR:\t\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"SYSTEMROOT"
,
buffer
, MAX_PATH);
std::wcout << L
"SYSTEMROOT:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"SYSTEMDRIVE"
,
buffer
, MAX_PATH);
std::wcout << L
"SYSTEMDRIVE:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"HOMEDRIVE"
,
buffer
, MAX_PATH);
std::wcout << L
"HOMEDRIVE:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"USERPROFILE"
,
buffer
, MAX_PATH);
std::wcout << L
"USERPROFILE:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"HOMEPATH"
,
buffer
, MAX_PATH);
std::wcout << L
"HOMEPATH:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"TMP"
,
buffer
, MAX_PATH);
std::wcout << L
"TMP:\t\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"TEMP"
,
buffer
, MAX_PATH);
std::wcout << L
"TEMP:\t\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"APPDATA"
,
buffer
, MAX_PATH);
std::wcout << L
"APPDATA:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"PROGRAMFILES"
,
buffer
, MAX_PATH);
std::wcout << L
"PROGRAMFILES:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"COMMONPROGRAMFILES"
,
buffer
, MAX_PATH);
std::wcout << L
"COMMONPROGRAMFILES:\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"USERNAME"
,
buffer
, MAX_PATH);
std::wcout << L
"USERNAME:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"ALLUSERSPROFILE"
,
buffer
, MAX_PATH);
std::wcout << L
"ALLUSERSPROFILE:\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"OS"
,
buffer
, MAX_PATH);
std::wcout << L
"OS:\t\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"COMPUTERNAME"
,
buffer
, MAX_PATH);
std::wcout << L
"COMPUTERNAME:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"NUMBER_OF_PROCESSORS"
,
buffer
, MAX_PATH);
std::wcout << L
"NUMBER_OF_PROCESSORS:\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"PROCESSOR_ARCHITECTURE"
,
buffer
, MAX_PATH);
std::wcout << L
"PROCESSOR_ARCHITECTURE:\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"PROCESSOR_LEVEL"
,
buffer
, MAX_PATH);
std::wcout << L
"PROCESSOR_LEVEL:\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"PROCESSOR_REVISION"
,
buffer
, MAX_PATH);
std::wcout << L
"PROCESSOR_REVISION:\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"USERDOMAIN"
,
buffer
, MAX_PATH);
std::wcout << L
"USERDOMAIN:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"COMSPEC"
,
buffer
, MAX_PATH);
std::wcout << L
"COMSPEC:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"PATHEXT"
,
buffer
, MAX_PATH);
std::wcout << L
"PATHEXT:\t\t"
<<
buffer
<< std::endl;
GetEnvironmentVariable(L
"PATH"
,
buffer
, MAX_PATH);
std::wcout << L
"PATH:\t\t"
<<
buffer
<< std::endl;
system(
"pause"
);
return
0
;
}