# DistributedApplicationBuilder.AddExecutable

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [DistributedApplicationBuilder](/reference/api/go/aspire.hosting/distributedapplicationbuilder.md)
- Version: `17.0.0`
- Kind: `method`

Adds an executable resource to the application model.

## Remarks

You can run any executable command using its full path.
As a security feature, Aspire doesn't run executable unless the command is located in a path listed in the PATH environment variable.
To run an executable file that's in the current directory, specify the full path or use the relative path `./` to represent the current directory.

## Definition

```go
type DistributedApplicationBuilder interface {
    // ... omitted for brevity
    AddExecutable(
        name string,
        command string,
        workingDirectory string,
        args []string,
    ) ExecutableResource
}
```

## Signature

```go
AddExecutable(
    name string,
    command string,
    workingDirectory string,
    args []string,
) ExecutableResource
```

## Parameters

- `name` (`string`) -- The name of the resource.
- `command` (`string`) -- The executable path. This can be a fully qualified path or a executable to run from the shell/command line.
- `workingDirectory` (`string`) -- The working directory of the executable.
- `args` (`[]string`) -- The arguments to the executable.

## Returns

[`ExecutableResource`](/reference/api/go/aspire.hosting/executableresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [DistributedApplicationBuilder](/reference/api/go/aspire.hosting/distributedapplicationbuilder.md) -- `interface`
