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

# 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](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md) method instead.

## Syntax

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

### 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](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/ixtfcopyfilecallback-xtffileio-xbox-microsoft-t.md) callback to call when the status of the copy changes.

### Return value

Type: HRESULT

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

## 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](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md) method instead.

## Requirements

**Header:** xtffileio.h

**Library:** xtffileio.lib

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

## See also

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


## Related topics

- [CopyFiles](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [OnStartFileCopy](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onstartfilecopy-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
- [OnFileCopyProgress](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onfilecopyprogress-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
- [XtfFileIO (API contents)](https://docs.xbox.com/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n.md)
- [IXtfBatchFileIOClient Interface (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfBatchFileIOClient/ixtfbatchfileioclient-xtffileio-xbox-microsoft-t.md)
