Hacker News new | past | comments | ask | show | jobs | submit login

If I remember correctly, the order was COM, EXE, BAT.

On NT platforms today, this is actually user-configurable via the PATHEXT environment variable - and that definitely has them in that order.

I wonder why that was the case. I remember reading some explanation about how it was about backwards compatibility, but that doesn't make much sense, since the first release of DOS 1.0 already had all three. Strictly speaking, COM as a format predates DOS (it's originally from CP/M), while EXE and BAT are more recent additions, COM files compiled for CP/M cannot run on DOS for other reasons, so there's still no compat issue there.




Having an order of precedence provides predictable behaviour and, perhaps more importantly, is simpler to implement than forcing disambiguation.

But probably it's just that they added the checks in that order and put no further thought into it.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: