V Pascale je na to funkcia GetEnv.