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

C/C++ API Documentation | 2026.1

# ClientApi::DefinePassword( const char *, Error * )

Sets `P4PASSWD` in the Windows registry and applies the setting immediately.

Virtual? | No |
Class | `ClientApi` |
Arguments | `const char *c` | the new `P4PASSWD` setting
| `Error *e` | an `Error` object
Returns | `void` |

## Notes

To make the new `P4PASSWD` setting apply to the next command executed with `Run()`, `DefinePassword()` sets the value in the registry and then calls `SetPassword()`.

`DefinePassword()` does not define a new server-side password for the user.

Call `DefinePassword()` with either the plaintext password, or its MD5 hash

## Example

The following code illustrates how this method might be used to make a Windows client application start up with a default `P4PASSWD` setting.

    client.Init( &e );
    client.DefinePassword( "default_pass", &e );

Your search for returned results