There is a well written answer from stackoverflow.
So, no it doesn't affect your commands. The handling of the ERRORLEVEL is just different. In cmd, the ERRORLEVEL will be set regardless if there is an error or not.
Bat only does, if there is an error.
New Quote from Wikipedia
The only known difference between .cmd
and .bat file execution is that in a
.cmd file the ERRORLEVEL variable
changes even on a successful command
that is affected by Command Extensions
(when Command Extensions are enabled),
whereas in .bat files the ERRORLEVEL
variable changes only upon errors.
The source for the Wikipedia quote above is actually based on this
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.
Note only is it a little more restrictive concerning the differences,
than the Wikipedia text, but is also worth being explicitly mentioned,
given the fact Mark
Zbikowski himself -
which gives a huge credibility bonus IMHO.