---
title: "directoryExists"
canonical: "https://support.appfire.com/space/PSJC/435028361/directoryExists"
format: markdown
---
> Macro (aura-html)


## Description

> Macro (excerpt)
> 
> Returns "true" if the directory exists and "false" otherwise.

Returns "true" if the directory exists and "false" otherwise.

|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | directoryExists(path_to_directory) | **Package** | file |
| **Alias** |  | **Pkg Usage** | dirExists(path_to_directory) |

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| path_to_directory | String | Yes | Specifies the name of the directory to locate. |

## Return Type

**Boolean (true/false)**

## Example

```javascript
if(directoryExists("C:/myDirectory")){
    print("The directory exists!");
} else {
    print("The directory does not exist!");
}
```

> ⚠️ It is recommended that you use forward slashes ( / ) for file paths.

## See also

> Macro (contentbylabel)