# findCommand

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

```ts
function findCommand(cmd, o?): Promise<string | null>;
```

Defined in: node/exe.ts:90

The file a shell would run for `cmd`, without starting one. POSIX: an executable file in a PATH
folder. Windows: every PATH folder in order (quoted entries allowed), trying PATHEXT with `.exe`
first; only names with a PATHEXT extension are found (as `CreateProcess` would), never an
extensionless file. A command containing a path separator must be absolute and is never searched;
relative PATH entries (e.g. `.`) are skipped, so nothing is looked up in the current directory.
Null when nothing is found.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `cmd` | `string` |
| `o?` | `Omit`\<[`ResolveOptions`](https://uncage.vercel.app/docs/api/protocol/node/interfaces/resolveoptions.md), `"execPath"`\> |

## Returns

`Promise`\<`string` \| `null`\>
