What's the difference between *.bat and *.cmd file?

smwikipedia picture smwikipedia · Mar 18, 2011 · Viewed 44.7k times · Source

Possible Duplicate:
Windows batch files: .bat vs .cmd?

Hi,

I am learning Windows Batch programming and come across this question:

What's the difference between .bat and .cmd file?

If they are the same, why need 2 of them?

BTW, what's the difference between command.com and cmd.exe ?

Answer

Ken White picture Ken White · Mar 18, 2011

.bat files are left-overs from DOS. .cmd files are for Window NT command processor or higher, and have more capabilities (some looping structures, the ability to call and return from procedural type blocks).

command.com was what ran the operating system and contained the internal commands like dir in DOS and early versions of Windows. It was replaced by cmd.exe when Windows NT was introduced, and was the first 32-bit command processor.