I dont really understand whats going on and cant see the difference:
I’m downloaded the base64.exe for creating base64 text under windows. i copied it to C:\Windows\ because its in the %PATH% variable.
Now i want to try it: echo Hello | base64 works great. Okay i dont need to append .exe and as far as i know i dont need to do it also with .bat and .com files.
But now i have some cygwin tools installed and for example tried which base64, which doesnt work, because it says that base64 is not in path. Then i typed in which base64.exe and got C:\Windows.
So my question is now: when i need to use .exe and when i dont? Is it only when i’m using cygwin tools that i need to append .exe?
Cygwin is a shell which emulates UNIX behaviour. UNIX doesn’t know anything about
.exe, thats why Cygwin can’t findbase64.exe. Under UNIX, binaries are stored without an extionsion added to their filename, e.g. justbase64.Windows CMD automatically appends
.bat,.com,.exeand the like to your file names. Cygwin does not. So if you are using a linux shell you have to append it manually.Since Cygwin is aware that it always runs under Windows it might append
.exeif you want to perform certain actions in the shell itself (e.g. opening a file), to behave more friendyl to Windows users who expect this behaviour. However programs running under Cygwin might not integrate those features since they were mainly devoloped for usage under UNIX. That could be a reason whywhich base64fails.