//updateENV.cpp /////////////////////////////////////////////////////////////////
int APIENTRY WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{  unsigned long dwReturnValue; 
   SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", 
                      SMTO_ABORTIFHUNG, 5000, &dwReturnValue);          return 0;                      
}
/////////////////////////////////////////////////////////////////////////////////
updateENV.exe
example: rightClickMyComputer ->Properties ->Advanced ->Environment Variables ->SystemVariables ->Path ->;addDir...;
... run updateENV.exe.