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

# WdDeleteOptions

> Reference for WdDeleteOptions, which sets the common root alias and whether to delete the root folder during a WdDeleteRemoteFiles operation.

Specifies options for a delete operation on a remote device.

**Introduced in:** [RIT 0.0.13-preview](https://docs.xbox.com/reference/remoting/release-versions.md#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](https://docs.xbox.com/reference/remoting/functions/wddeleteremotefiles.md) 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](https://docs.xbox.com/reference/remoting/functions/wddeleteremotefiles.md) 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](https://docs.xbox.com/reference/remoting/functions/wddeleteremotefiles.md)
* [WdDeleteSearchOptions](https://docs.xbox.com/reference/remoting/structs/wddeletesearchoptions.md)
* [XBOX PC Remote Iteration API](https://docs.xbox.com/reference/remoting/remoteiteration_members.md)


## Related topics

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