3 ms·
Odd, I lived through the same period, and don't recall a situation where .cmd vs .bat ever made a difference to the interpreter. On DOS-based Windows (i.e. up
by quietbritishjim 5y ago
Odd, I lived through the same period, and don't recall a situation where .cmd vs .bat ever made a difference to the interpreter.
On DOS-based Windows (i.e. up to 3.1, and then 95/98/ME) only COMMAND.COM was available, so certainly that was always used as the interpreter.
The native Windows 32-bit cmd.exe was introduced on NT-based Windows (i.e. 3.1/3.5(1)/4/2000, then XP and all following mainstream Windows). A virtualised form of DOS was available on the NT line so in principle you could also run your batch files through the old COMMAND.COM. This is where I'm least confident, but I thought that the extension wouldn't make that choice though - it would use the 32-bit cmd.exe even if the extension was .bat, unless you explicitly started a DOS instance and ran it through that. After all, one of the design goals of cmd.exe was to be a drop-in replacement for the old DOS interpreter.
- GordonS 5y agoHmm, same here, I've never known any difference. I do use `.cmd` instead of `.bat`, but only through personal preference, nothing more.
- Jaruzel 5y agoWikipedia link on the differences: https://en.wikipedia.org/wiki/Batch_file#Filename_extensions https://en.wikipedia.org/wiki/Batch_file#Filename_extensions Which also links to: http://waynes-world-it.blogspot.com/2008/08/difference-between-bat-and-cmd.html http://waynes-world-it.blogspot.com/2008/08/difference-betwe... There used to be a microsoft.com page on it too, but that's been lost to time.
- quietbritishjim 5y agoThose articles match my understanding, but it's a bit different to your previous comment (but maybe I misunderstood your previous comment). I thought you were saying that there was at least one version of Windows where .cmd would run in cmd.exe while .bat would run on COMMAND.COM. Whereas I think the actual situation is that: on Win95 .bat would run on COMMAND.COM whereas .cmd wouldn't run at all; on NT .bat and .cmd would both run on cmd.exe. As a result, if you used .cmd you could be sure that it would never run on COMMAND.COM, so you could use the new command extensions in cmd.exe without worrying about it causing a confusing error.
- Jaruzel 5y agoNow you say it, I'm not sure either tbh. During that period I was principally an NT user, and I never really used 95/98. When I get a mo, I might fire up an NT VM and see what actually happens. Maybe.... .bat and .cmd DO both run cmd.exe, but the former disables the command extensions?