> ## 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::SetFileAttributes Method

> IXtfFileIOClient::SetFileAttributes Method

# IXtfFileIOClient::SetFileAttributes Method

Sets attributes for files on the development console.

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

*pszSearchPattern*\
Type: LPCWSTR

Pointer to the search pattern that defines the filenames of the files to set the attributes of. 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 operation. 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 operation. 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 operation.

*dwAddAttributes*\
Type: DWORD

Bitwise-OR combination of file attributes to add to the files.

*dwRemoveAttributes*\
Type: DWORD

Bitwise-OR combination of file attributes to remove from the files.

*pCallback*\
Type: IXtfFindFileCallback\*

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

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code.

<a id="remarksSection" />

## Remarks

This function sets the file attributes of a specified file on the development console. If an error occurs, this function returns an HRESULT error code. For more information about HRESULT error codes specific to XBOX Tools Framework (XTF) API, see [XTF transport errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors).

Use the [IXtfFileIOClient::GetFileAttributes](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/setfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m) method to get the file attributes of a specified file on the development console.

<a id="requirementsSection" />

## Requirements

**Header:** xtffileio.h

**Library:** xtffileio.lib

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

<a id="seealsoSection" />

## See also

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


## Related topics

- [IXtfFileIOClient::GetFileAttributes Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::FindFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/findfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::DeleteFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-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)
