# resolveCommand

<!-- https://uncage.vercel.app/docs/api/protocol/node/functions/resolvecommand/ -->

```ts
function resolveCommand(
   cmd, 
   args?, 
   o?
): Promise<
  | ResolvedCommand
| null>;
```

Defined in: node/exe.ts:246

Finds `cmd` like `findCommand` and makes it startable without a shell. POSIX: the file found.
Windows: a `.exe`/`.com` directly; an npm `.cmd` shim becomes its Node + JS target (or its `.exe`
target); any other `.cmd`/`.bat` runs through the absolute cmd.exe (`/d /s /c`) with every argument
quoted. Null when nothing is found. Throws `UnsafeCommandError` when a `.cmd`/`.bat` cannot be
started safely (no absolute cmd.exe, or an argument with `"`, `%`, `!`, `^` or a line break).

## Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `cmd` | `string` | `undefined` |
| `args?` | `string`[] | `[]` |
| `o?` | [`ResolveOptions`](https://uncage.vercel.app/docs/api/protocol/node/interfaces/resolveoptions.md) | `{}` |

## Returns

`Promise`\<
  \| [`ResolvedCommand`](https://uncage.vercel.app/docs/api/protocol/node/interfaces/resolvedcommand.md)
  \| `null`\>
