# spawnWindows: If an exe is found but fails to exec, retry with PATHEXT values appended · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d3242408d4bed933c589a8143f4a06851795bdd1)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d3242408d4bed933c589a8143f4a06851795bdd1

Requested commit: d3242408d4bed933c589a8143f4a06851795bdd1

Commit: d3242408d4bed933c589a8143f4a06851795bdd1

Tree: fe006391494c1d85497f9ebd584ce570dd518165

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
spawnWindows: If an exe is found but fails to exec, retry with PATHEXT values appended

This matches `cmd.exe` behavior. For example, if there is only a file named `mycommand` in the cwd but it is a Linux executable, then running the command `mycommand` will result in:

'mycommand' is not recognized as an internal or external command, operable program or batch file.

However, if there is *both* a `mycommand` (that is a Linux executable) and a `mycommand.exe` that is a valid Windows exe, then running the command `mycommand` will successfully run `mycommand.exe`.

```

## Parents

- [5843b7987e705ec01d07cd98a7f7bb10aa579587](https://git.cafe/gitcafe/zig/commit/5843b7987e705ec01d07cd98a7f7bb10aa579587?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d3242408d4bed933c589a8143f4a06851795bdd1?format=markdown)
