1、获取系统变量,返回0表示没有找到
DWORD GetEnvironmentVariable( LPCTSTR lpName, // environment variable name LPTSTR lpBuffer, // buffer for variable value DWORD nSize // size of buffer );
2、The GetEnvironmentStrings function retrieves the environment block for the current process.
LPVOID GetEnvironmentStrings(VOID);
3、The SetEnvironmentVariable function sets the contents of the specified environment variable for the current process.
BOOL SetEnvironmentVariable( LPCTSTR lpName, // environment variable name LPCTSTR lpValue // new value for variable );4、GetCurrentDirectoryThe GetCurrentDirectory function retrieves the current directory for the current process.
DWORD GetCurrentDirectory( DWORD nBufferLength, // size of directory buffer LPTSTR lpBuffer // directory buffer );5、The SetCurrentDirectory function changes the current directory for the current process.
BOOL SetCurrentDirectory( LPCTSTR lpPathName // new directory name );