# safeExecFile

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

```ts
function safeExecFile(
   file, 
   args, 
   o?
): Promise<
  | {
  args: string[];
  file: string;
}
| null>;
```

Defined in: node/exe.ts:201

What to hand `execFile` / `spawn` for `file` without ever searching the current directory. POSIX,
or a path (absolute or with a separator): `file` unchanged. Windows bare names: a known system
tool → `systemTool`; anything else → `resolveCommand` (PATH only; npm shims and `.cmd` files made
startable without a shell). Null when a bare name is not found.

## Parameters

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

## Returns

`Promise`\<
  \| \{
  `args`: `string`[];
  `file`: `string`;
\}
  \| `null`\>
