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

# Méthode IXtfRemoteRunClient::Run

> Méthode IXtfRemoteRunClient::Run

# Méthode IXtfRemoteRunClient::Run

Exécute une commande donnée sur la console.

<a id="syntaxSection" />

## Syntaxe

```cpp theme={null}
public:
HRESULT Run(
         LPCWSTR pszCommandLine,
         LPCWSTR pszWorkingDirectory,
         DWORD dwFlags,
         DWORD dwPeriod,
         IXtfRemoteRunCallback *pCallback
)  
```

<a id="ID4EG" />

<a id="parametersSection" />

### Paramètres

*pszCommandLine*\
Type : LPCWSTR

Ligne de commande à exécuter sur la console distante.

*pszWorkingDirectory*\
Type : LPCWSTR

Répertoire de travail sur la console distante.

*dwFlags*\
Type : DWORD

Un ou plusieurs des indicateurs décrits dans la section Remarques.

*dwPeriod*\
Type : DWORD

Lorsque la sortie est redirigée, elle est regroupée par lots et renvoyée périodiquement au client. Cette valeur spécifie le nombre de millisecondes entre les opérations de regroupement.

*pCallback*\
Type : [IXtfRemoteRunCallback \*](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/interfaces/ixtfremoteruncallback)

Rappel utilisé lorsque l'entrée ou la sortie standard est redirigée.

<a id="ID4EP" />

<a id="retvalSection" />

### Valeur de retour

Type : HRESULT

Code de réussite ou d'erreur HRESULT.

<a id="remarks" />

## Remarques

Le paramètre dwFlags est un AND au niveau du bit de l'une des valeurs suivantes :

| Valeur d'indicateur | Effet |
| - | - |
| XTFRUN\_WAIT | Attend la fin de la commande. Le comportement par défaut consiste à exécuter la commande et à retourner immédiatement sans attendre la fin. |
| XTFRUN\_GUEST\_USER | Exécute sous le compte d'utilisateur invité. Le comportement par défaut consiste à exécuter en tant qu'utilisateur système avec privilèges élevés. |
| XTFRUN\_REDIRECT\_INPUT | Redirige l'entrée standard via le pCallback donné. Implique XTFRUN\_WAIT. |
| XTFRUN\_REDIRECT\_OUTPUT | Redirige la sortie standard via le pCallback donné. Implique XTFRUN\_WAIT. |
| XTFRUN\_REDIRECT\_BOTH | Redirige à la fois l'entrée standard et la sortie standard via le pCallback donné. Implique XTFRUN\_WAIT. |

[IXtfRemoteRunCallback](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/interfaces/ixtfremoteruncallback) contient à la fois une fonction de rappel d'entrée et une fonction de rappel de sortie. Vous pouvez renseigner l'un de ces membres ou les deux, selon que vous avez besoin d'une entrée *ou* d'une sortie pour une fonction, ou d'une entrée *et* d'une sortie pour une fonction.

Pour plus d'informations sur l'*entrée* du rappel, consultez [IXtfRemoteRunCallback::Input](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/methods/ixtfremoteruncallback_input).

Pour plus d'informations sur la *sortie* du rappel, consultez [IXtfRemoteRunCallback::Output](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/methods/ixtfremoteruncallback_output).

<a id="requirements" />

## Configuration requise

**En-tête :** xtfremoterun.h

**Bibliothèque :** xtfremoterun.lib

**Plateformes prises en charge :** Windows (pour les outils de console XBOX)

## Voir aussi

[XtfRemoteRun](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunClient/interfaces/ixtfremoterunclient)\
[IXtfRemoteRunClient](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunClient/interfaces/ixtfremoterunclient)\
[IXtfRemoteRunCallback](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/interfaces/ixtfremoteruncallback)


## Related topics

- [Interface IXtfRemoteRunClient](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunClient/interfaces/ixtfremoterunclient.md)
- [Méthode XtfCreateRemoteRunClient](/fr/reference/tools/xtf/xtfremoterun/methods/xtfremoterun_xtfcreateremoterunclient.md)
- [Méthode IXtfRemoteRunCallback::Input](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/methods/ixtfremoteruncallback_input.md)
- [Méthode IXtfRemoteRunCallback::Output](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/methods/ixtfremoteruncallback_output.md)
- [Interface IXtfRemoteRunCallback](/fr/reference/tools/xtf/xtfremoterun/classes/IXtfRemoteRunCallback/interfaces/ixtfremoteruncallback.md)
