I am Utpal Vishwas from Uttar Pradesh. Have completed my B. Tech. course from MNNIT campus Prayagraj in 2022. I have good knowledge of computer networking.
.bat and .cmd are both file extensions for batch files in Windows. A batch file is a text file that contains a series of commands that are executed by the command prompt.
The main difference between .bat and .cmd files is that .cmd files are executed by the cmd.exe command processor, while .bat files are executed by the command.com command processor. The cmd.exe command processor is a newer version of the command.com command processor, and it has some additional features, such as the ability to run scripts that contain loops and conditional statements.
In general, you should use .cmd files if you want to take advantage of the additional features of the cmd.exe command processor. However, if you are creating a batch file that is compatible with older versions of Windows, you should use a .bat file.
Here is a table that summarizes the differences between .bat and .cmd files:
Feature
.bat
.cmd
File extension
.bat
.cmd
Command processor
command.com
cmd.exe
Features
Basic commands
Basic commands, loops, conditional statements
Compatibility
Compatible with all versions of Windows
Compatible with Windows NT and later versions
Liked By
Write Answer
Windows batch files: .bat vs .cmd?
Join MindStick Community
You have need login or register for voting of answers or question.
Aryan Kumar
15-Jul-2023.bat and .cmd are both file extensions for batch files in Windows. A batch file is a text file that contains a series of commands that are executed by the command prompt.
The main difference between .bat and .cmd files is that .cmd files are executed by the cmd.exe command processor, while .bat files are executed by the command.com command processor. The cmd.exe command processor is a newer version of the command.com command processor, and it has some additional features, such as the ability to run scripts that contain loops and conditional statements.
In general, you should use .cmd files if you want to take advantage of the additional features of the cmd.exe command processor. However, if you are creating a batch file that is compatible with older versions of Windows, you should use a .bat file.
Here is a table that summarizes the differences between .bat and .cmd files: