What's the difference between *.bat and *.cmd file? [duplicate] What's the difference between *.bat and *.cmd file? [duplicate] windows windows

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


.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.


This might help you
Windows batch files: .bat vs .cmd?
http://www.pcreview.co.uk/forums/cmd-vs-bat-t1468592.html
A documented difference found in google groups
The differences between .CMD and .BAT as far as CMD.EXE is concerned are: With extensions enabled, PATH/APPEND/PROMPT/SET/ASSOC in .CMD files will set ERRORLEVEL regardless of error. .BAT sets ERRORLEVEL only on errors.