> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/files/deletedirectory.md).

# DeleteDirectory

Deletes all directories and subdirectories in the specified path. Will not do anything if the directory do not exist.

Task version: 1.1.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Files/tree/main/Frends.Files.DeleteDirectory>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                 | Description                                                                                       |
| -------------------- | ------------------------------------------------------------------------------------------------- |
| Directory : `String` | <p>Directory path.</p><p><br>Default: <code>"c:\temp"</code><br>Example: <code>C:\Temp</code></p> |
| {% endtab %}         |                                                                                                   |

{% tab title="Options" %}

| Name                                                    | Description                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DeleteRecursively : `Boolean`                           | <p>Delete all files and sub folders.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                           |
| UseGivenUserCredentialsForRemoteConnections : `Boolean` | <p>If set, allows you to give the user credentials to use to create directories on remote hosts.</p><p>If not set, the agent service user credentials will be used.</p><p>Note: For creating directories on the local machine, the agent service user credentials will always be used, even if this option is set.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p> |
| UserName : `String`                                     | <p>This needs to be of format domain\username</p><p><br>Default: <code>"domain\username"</code><br>Example: <code>Domain\Username</code></p>                                                                                                                                                                                                                                           |
| 🗝Password : `String`                                   | <p>Password of user</p><p><br>Default: <code>-</code><br>Example: <code>Password123</code></p>                                                                                                                                                                                                                                                                                         |
| {% endtab %}                                            |                                                                                                                                                                                                                                                                                                                                                                                        |
| {% endtabs %}                                           |                                                                                                                                                                                                                                                                                                                                                                                        |

## Task Result

| Name                | Description                                                            |
| ------------------- | ---------------------------------------------------------------------- |
| Path : `String`     | <p>Path of directory<br>Example: <code>C:/User/NewDirectory</code></p> |
| Success : `Boolean` | <p>Directory found<br>Example: <code>C:/User/NewDirectory</code></p>   |

## Task Changelog

Changelog for Task Frends.Files.DeleteDirectory.

### \[1.1.0] - 2025-03-19

#### Changed

* Update packages: Newtonsoft.Json 12.0.1 -> 13.0.3 System.ComponentModel.Annotations 4.7.0 -> 5.0.0 System.Runtime.Caching 7.0.0 -> 9.0.3 coverlet.collector 3.1.0 -> 6.0.4 Microsoft.NET.Test.Sdk 16.7.0 -> 17.13.0 MSTest.TestAdapter 2.1.2 -> 3.8.3 MSTest.TestFramework 2.1.2 -> 3.8.3 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0 RichardSzalay.MockHttp 6.0.0 -> 7.0.0 xunit.extensibility.core 2.4.2 -> 2.9.3

### \[1.0.0] - 2023-07-21

#### Added

* Initial implementation of Frends.Files.DeleteDirectory.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.frends.com/tasks/tasks/files/deletedirectory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
