# (setenv variable value)
[GstarCAD 2011](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<a id="262"></a>
## (setenv variable value)
---
Set the operating system variable to that value.
---
This function sets the *value* of a specified operating system environment *variable*-for example, as stored by the DOS PATH variable.
### NOTES
- If you give **setenv** a non-existent variable name, it creates that, and sets it. You can see the new variable name from within GstarCAD®'s "shell" DOS window (created by the **Shell** command) but not from the Windows DOS window. **Setenv** creates the variable within GstarCAD's application space.
- When you enter *GstarCAD* or *ACAD* as the environment variable you want to set, the **setenv** function changes that to the SEARCHPATH variable and uses it normally.
**Example**
| Code | Returns |
| --- | --- |
| (**setenv** "PATH" "C:\\\\;C:\\\\WIN95;C:\\\\GstarCAD") | "C:\\\\;C:\\\\WIN95;C:\\\\GstarCAD" |
**Tell me about...**
[(getenv variable)](%28getenv%20variable%29.md)
[(setcfg parameter value)](%28setcfg%20parameter%20value%29.md)
[(setvar sysvar value)](%28setvar%20sysvar%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 2012](../../../../2012/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28setenv%20variable%20value%29.md)