# CWDIR Change Working Directory

> Source: https://manual.pvxplus.com/directives/cwdir

## Format

**CWDIR** *new_dir$*\[,**ERR**=*stmtref*\]

***Where:***

|  |  |
| --- | --- |
| *new_dir$* | String expression. Name of the new directory in which you want to work or run applications. Include a disk letter and colon ":" to change to another drive. |
| *stmtref* | Program line number or statement label to which to transfer control. |

## Description

Use the **CWDIR** directive to change from the current working directory to a new one. If the specified directory name does not exist, PxPlus returns an Error #12: File does not exist (or already exists).

## See Also

**[LWD Current Working Directory](https://manual.pvxplus.com/variables/lwd)**  
**[HWD Starting/Home Directory](https://manual.pvxplus.com/variables/hwd)**

## Example

```
cwdir "C:\"+C$+"PROGS"
run "SOMETHING"
cwdir hwd ! Return home
```
