# MosDirectories

The MosDirectories object provides functions used for working with directories.&#x20;

{% hint style="warning" %}
Please note that calling any function of the *MosDirectories* object will immediately put the script module into demo mode if it is not licensed
{% endhint %}

### Methods <a href="#h.dlb4khgqvtip" id="h.dlb4khgqvtip"></a>

| **Name**                      | **Description**                                                                                                                              |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| exists(directoryPath)         | Checks if the directory specified in *directoryPath* exists. If the directory exists on the disk, returns *True*, otherwise returns *False*. |
| delete(directoryPath)         | Removes directory specified in *directoryPath*.                                                                                              |
| create(directoryPath)         | Creates directory specified in *directoryPath*.                                                                                              |
| getDirectories(directoryPath) | Returns a string array containing the names of subdirectories from the directory specified in *directoryPath*.                               |
| getFiles(directoryPath)       | Returns a string array containing the names of files from the directory specified in *directoryPath*.                                        |

### Examples <a href="#h.n2649nvexuvj" id="h.n2649nvexuvj"></a>

The following example shows an expression that checks for the existence of a folder named Windows on the target computer:

```javascript
var path = 'c:\\windows';
return MosDirectories.exists(path);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/scripts/api/mosdirectories.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
