Subject: Re: bug#71655: Eshell external commands do not work under GNU Emacs for Windows

From: Eli Zaretskii <[email-masked]>
Date: Wed, 19 Jun 2024 22:12:34 +0300

> Date: Wed, 19 Jun 2024 15:53:14 +0000
> From:  James Hilling via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> There appears to be a potential bug with Eshell when running external commands on GNU Emacs for
> Windows, i.e. not WSL/WSL2/Cygwin.

I don't think this has anything to do with Eshell.  Or Emacs, for that
matter.  See below.

> To reproduce:
> 
> Start Emacs with "-Q", open Eshell with `M-x eshell`, run `winget.exe --help`.
> 
> (Eshell) $ winget --help
> 
> Opening input file: Invalid argument, C:/Users/MyUser/AppData/Local/Microsoft/WindowsApps/winget.exe
> 
> For some reason external commands such as `winget.exe` do not appear to be working properly.

Try

  (Eshell) $ ls -l C:/Users/MyUser/AppData/Local/Microsoft/WindowsApps/winget.exe

What do you see?  Does what you see explain the error?

I think this page explains what is going on:

  https://stackoverflow.com/questions/58296925/what-is-zero-byte-executable-files-in-windows