.com are executable files limited to 64k of size
.exe are executable files with no size limit
.bat are Batch file to script program execution...
.com was the original executable... (it contained no header, just executable code)
then computers advanced and so did the programs, along with there size...
.exe's were created and contain a header to give an explaination of the file data to the OS...
the header is how the operating system knows what OS the program was written for as well as other data...
this is why, in the DOS days, if you tried to run a windows program in DOS, you would get an error telling you that it was a windows executable...
Batch files were created to save steps in typing...
if you have a program that has command line options like
myprogram.exe -run -help
you can open up a text editor and type that in and then save the file as a .bat file, so next time instead of typeing all of the options and what not... you just type the name of the batch file and press enter...
.com files are usually written in Assembly language, or other low level languages...
.exe are usually written in C/C++, Basic, Pascal, and other High level languages...
and if you are REALLY smart, or just have a lot of time on your hands, you can get a Hex Editor and directly enter the HEX CODES (machine code) for a program and save it as a .com and execute it... where you probably would not want to even try that with an EXE...
.COM and .EXE files are Binary Files
.BAT files are TEXT Files
.exe's WERE NOT CREATED FOR WINDOWS... they were also the main executables in DOS, OS2, MAC, WIN 3.1, WIN 9X, WIN CE, and pretty much every other OS, This does not mean that the all work on all of the systems... since every operating system has different OP Codes... Which is actually the reason Java and HTML were created, now you have universal binary files and html text files that a java virtual machines and web browsers interpret on most of the platforms the same way...
Hope this clears a few things up...
Have Fun, Be Young... Code BASIC
-Josh Stribling