Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2026.1

# ClientUser::RunCmd( const char *, const char *, […​], Error * )

Call an external program.

Virtual? | No |
Class | `ClientUser` (static) |
Arguments | `const char *command` | the executable to be called
| `const char *arg1` | the first argument
| `const char *arg2` | the second argument
| `const char *arg3` | the third argument
| `const char *arg4` | the fourth argument
| `const char *pager` | a pager, if any
| `Error *e` | an `Error` object to hold system errors
Returns | `void` |

## Notes

`RunCmd()` is called when the client needs to call an external program, such as a merge or diff utility. `RunCmd()` stores any resulting errors in the specified `Error` object.

## Example

If you select "d" for "Diff" during an interactive resolve, and both `P4DIFF` and `P4PAGER` are set in your environment, `RunCmd()` is called with the following arguments:

Argument | Value
--- | ---
`command` | `P4DIFF`
`arg1` | local file name
`arg2` | temp file name (depot file)
`arg3` | null
`arg4` | null
`pager` | `P4PAGER`

The `P4DIFF` program is called with the two file names as arguments, and the output is piped through the `P4PAGER` program.

See the examples for `Diff()` and `Merge()` for code illustrating the use of `RunCmd()`.

Your search for returned results