# (getenv variable)
[GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<a id="187"></a>
## (getenv variable)
---
Determine the value of the operating system variable.
---
This function returns the value of a specified operating system environment variable-for example, as stored by the DOS PATH variable. If the variable exists, its value is returned as a string; if it does not exist, *nil* is returned.
### Examples
| Code | Returns |
| --- | --- |
| (**getenv** "PATH") | C:\\\\;C:\\\\WIN95;C:\\\\ICAD |
| (**getenv** "junk") | nil |
**Tell me about...**
[(getcfg parameter)](%28getcfg%20parameter%29.md)
[(getvar sysvar)](%28getvar%20sysvar%29.md)
[(setenv variable value)](%28setenv%20variable%20value%29.md)
[LISP Compatibility](../LISP%20Compatibility.md)
[Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md)
<a id="holding"></a>
## Other versions with matching text
[GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28getenv%20variable%29.md)