> ## 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.

# IXtfFileIOClient::DeleteFiles Method

> IXtfFileIOClient::DeleteFiles Method

# IXtfFileIOClient::DeleteFiles Method

Deletes files from the development console.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT DeleteFiles(
         LPCWSTR pszSearchPattern,
         DWORD dwIncludeAttributes,
         DWORD dwExcludeAttributes,
         DWORD dwRecursionLevels,
         DWORD dwFlags,
         IXtfFindFileCallback *pCallback
)  
```

<a id="ID4EH" />

### Parameters

*pszSearchPattern*\
Type: LPCWSTR

Pointer to the search pattern that defines the filenames of the files to delete.\
This parameter accepts wildcard characters to match strings with the indicated pattern.

*dwIncludeAttributes*\
Type: DWORD

Bitwise-OR combination of file attributes to include for the delete. See [File Attribute Constants](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx) for a list of possible attributes.

*dwExcludeAttributes*\
Type: DWORD

Bitwise-OR combination of file attributes to exclude from the delete. See [File Attribute Constants](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx) for a list of possible attributes.

*dwRecursionLevels*\
Type: DWORD

Number of directory levels to recurse for the delete.

*dwFlags*\
Type: DWORD

Flags that specify how to delete the files. This is a bitwise-OR combination of the macros listed in the following table.

| Value      | Macro                | Description              |
| ---------- | -------------------- | ------------------------ |
| 0x80000000 | XTFDELETEFILE\_DEFER | Defer the file deletion. |

*pCallback*\
Type: IXtfFindFileCallback \*

Pointer to the [IXtfFindFileCallback](/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t) callback to call when a file to delete is found.

<a id="ID4EQ" />

### Return value

Type: HRESULT

HRESULT success or error code.

<a id="requirements" />

## Remarks

When deleting files *dwIncludeAttributes* and *dwExcludeAttributes* act as filters on which files are deleted, it does not act as a filter on which file attributes are deleted when deleting files. The [IXtfFindFileCallback's](/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t) **onfindfile** function call will be called for each file being deleted. The callback function will return information about each file being deleted. The returned information can be used to return progress information about the progress of deletion.

## Requirements

**Header:** xtffileio.h

**Library:** xtffileio.lib

**Supported platforms:** Windows (for XBOX console tools)

<a id="ID4EPC" />

## See also

<a id="ID4ERC" />

[IXtfFileIOClient Interface](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/ixtffileioclient-xtffileio-xbox-microsoft-t)\
[XtfFileIO](/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n)\
[IXtfFindFileCallback](/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t)


## Related topics

- [IXtfFileIOClient::RemoveDirectory Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/removedirectory-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::FindFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/findfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::CopyFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::GetFileInfo Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileinfo-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::GetFileAttributes Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
