> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WdDeleteOptions

> WdDeleteOptions

# WdDeleteOptions

Specifies options for a delete operation on a remote device.

**Introduced in:** [RIT 0.0.13-preview](/reference/remoting/release-versions#release-versions).

## Syntax

```cpp theme={null}
struct WdDeleteOptions
{
    const char* commonRootAlias;
    bool deleteRootFolder;
};
```

### Members

`commonRootAlias`\
Type: **const char\***

An optional alias for a common root location on the remote device (UTF-8). Set to `nullptr` to use the default common root location.

`deleteRootFolder`\
Type: **bool**

When `true`, removal of the `remoteFolderPath` folder itself is attempted once its contents have been deleted, but only if it is left empty. A filtered delete that leaves items behind preserves the folder. When `false`, which is the default, only the contents of `remoteFolderPath` are deleted and the folder itself is left in place. This field is ignored when `remoteFolderPath` resolves to a single file.

This field controls only removal of `remoteFolderPath` itself. Regardless of its value, the operation attempts to remove empty subdirectories that pass the directory filters, including directories that were already empty.

## Remarks

Pass this structure to [WdDeleteRemoteFiles](/reference/remoting/functions/wddeleteremotefiles) via the `deleteOptions` parameter. If `nullptr` is passed for `deleteOptions`, the default common root location is used when `remoteFolderPath` is a relative path, and only the contents of the folder are deleted.

Deletion is best effort. A successful return from [WdDeleteRemoteFiles](/reference/remoting/functions/wddeleteremotefiles) does not guarantee that every selected item or the root folder was removed.

If `remoteFolderPath` is an absolute path, `commonRootAlias` is ignored. If `remoteFolderPath` is a relative path, it is resolved against the common root identified by the alias, or against the default common root location when no alias is specified.

## Requirements

| Requirement | Value |
| - | - |
| **Header** | WdRemoteIteration.h |
| **Library** | wdremoteapi.lib |
| **Supported OS** | Windows 11 and later |
| **Supported architectures** | x64, ARM64 |

## See also

* [WdDeleteRemoteFiles](/reference/remoting/functions/wddeleteremotefiles)
* [WdDeleteSearchOptions](/reference/remoting/structs/wddeletesearchoptions)
* [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members)


## Related topics

- [WdDeleteSearchOptions](/reference/remoting/structs/wddeletesearchoptions.md)
- [WdDeleteRemoteFiles](/reference/remoting/functions/wddeleteremotefiles.md)
- [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members.md)
- [XBOX PC Remote (wdRemote.exe)](/tools/tools-pc/commandlinetools/gr-wdRemote.md)
- [WdCopyOptions](/reference/remoting/structs/wdcopyoptions.md)
