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

# IXtfBatchFileIOClient::CopyFiles Method

> IXtfBatchFileIOClient::CopyFiles Method

# IXtfBatchFileIOClient::CopyFiles Method

Batch-copies files enumerated in a list of strings between two locations on a development console and returns information about the operation.

<Note>This method is deprecated. Use the [IXtfFileIOClient::CopyFiles](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m) method instead.</Note>

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT CopyFiles(
         LPCWSTR pszRootDirectory,
         LPCWSTR *rgszRootDirectoryRelativeFiles,
         DWORD cRootDirectoryRelativeFiles,
         LPCWSTR pszDstDirectoryName,
         DWORD dwFlags,
         IXtfCopyFileCallback *pCallback
)  
```

<a id="parametersSection" />

### Parameters

*pszRootDirectory*\
Type: LPCWSTR

A pointer to the root directory for the batch copy.

*rgszRootDirectoryRelativeFiles*\
Type: LPCWSTR\*

A pointer to a list of strings which contains the names of the files to be copied.

*cRootDirectoryRelativeFiles*\
Type: DWORD

The number of files for the batch copy.

*pszDstDirectoryName*\
Type: LPCWSTR

A pointer to the destination directory name for the batch copy.

*dwFlags*\
Type: DWORD

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

| Value      | Macro              | Description          |
| ---------- | ------------------ | -------------------- |
| 0x80000000 | XTFCOPYFILE\_DEFER | Defer the file copy. |

*pCallback*\
Type: IXtfCopyFileCallback\*

Pointer to the [IXtfCopyFileCallback](/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/ixtfcopyfilecallback-xtffileio-xbox-microsoft-t) callback to call when the status of the copy changes.

<a id="retvalSection" />

### Return value

Type: HRESULT

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

<a id="remarksSection" />

## Remarks

This function copies files enumerated in a list of strings between two locations on a development console as a batch operation and returns information about the operation.

<Note>This method is deprecated. Use the [IXtfFileIOClient::CopyFiles](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m) method instead.</Note>

## Requirements

**Header:** xtffileio.h

**Library:** xtffileio.lib

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

## See also

[IXtfFileIOClient::CopyFiles](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m)\
[IXtfBatchFileIOClient Interface](/reference/tools/xtf/xtffileio/classes/IXtfBatchFileIOClient/ixtfbatchfileioclient-xtffileio-xbox-microsoft-t)\
[XtfFileIO](/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n)


## Related topics

- [IXtfFileIOClient::CopyFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfCopyFileCallback::OnStartFileCopy Method](/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onstartfilecopy-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
- [IXtfCopyFileCallback::OnEndFileCopy Method](/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onendfilecopy-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
- [IXtfCopyFileCallback::OnFileCopyProgress Method](/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onfilecopyprogress-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::FindFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/findfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
