What are the differences between . bat and . cmd?

Asked

Viewed 1,028 times

6

We rarely see file .cmd, but when opening it, we see that its content is very close to a .bat.

  • What is the reason for this similarity ?
  • What would be the main differences between them ?

1 answer

4


The only difference between .cmd and .bat, is that in the .cmd the variable ERRORLEVEL also in the case of successful commands affected by command extensions when activated (PATH/APPEND/PROMPT/SET/ASSOC).

Already in the .bat the variable ERRORLEVEL will only change in case of an error.

Source

  • 1

    Sacha, when you "copy" the answer from somewhere, it’s nice to post the source. You should also pay attention to incorrect "translations". I’ve got it right for you.

  • 1

    Edited ! Obg ! Friend sorry if not to understand I am French-speaking !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.