# execTarget

<!-- https://uncage.vercel.app/docs/api/agent/functions/exectarget/ -->

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

Defined in: agent/src/exe.ts:40

`file` + `args` ready for `execFile` without a current-directory lookup: on Windows a bare system
tool name (`icacls`, `schtasks`, `reg`, `taskkill`, `powershell.exe`, `rundll32`, …) becomes its
absolute `%SystemRoot%\System32` path and any other bare name is resolved on PATH
(`resolveCommand`). Throws ENOENT when a bare name is not found. POSIX: unchanged.

## Parameters

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

## Returns

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