Open In App

Difference between CMD and BAT

Improve
Improve
Like Article
Like
Save
Share
Report

1. CMD: A CMD file is a script file that incorporates one or more instructions in a simple textual content format that are performed in order to operate a range of tasks. It is comparable to a .BAT file, which is additionally in many instances used to keep a batch of executable commands.CMD is the command immediately in the gadget and the programming language is referred to as DOS batch language. This file type was produced by means of Microsoft to be used for the implementation of Windows NT command scripts.

2. BAT: BAT files have an extension .BAT which means batch processing file. It’s a simple textual content file that incorporates a number of instructions used for repetitive tasks or to run groups of scripts one after another. BAT files are used for quite a number of purposes such as running applications, replicating files, deleting files, and shutting down processes. They are additionally referred to as batch files, shell scripts, batch programs, & command files.

Difference between CMD and BAT:

S. No. CMD BAT
1. It has a CMD interpreter to run commands.  It has an NT Virtual DOS Machine to run commands. 
2. It has many advanced features as compared to BAT. It has old features ad not offer error level many advanced features yet because it is an old type of file.
3. It handles the error level variable by changing its state even if no error takes place. In this, this variable is solely modified as soon as a real error takes place and no change in the state takes place when each command executes successfully.
4. It supports only cmd.exe. It supports  cmd.exe. as well as command.com.
5. These files support nearly all windows versions as it is a new file type. These files are not supported in all windows versions as it is an old file type.
6. It is a unique kind of file. It is not a unique kind of file.
7. It does not sequentially process files.  It processes files in a sequential manner.
8. It is more secure than BAT files. It is not secure as CMD files.
9. It is executed in the cmd interpreter. It runs in NTDVM environment.
10. When the error level is called using CMD, error level is reset. When the error level is called using BAT, execution of the previous command happens.
11. It has an application in Android which makes it to view, install and run CMD scripts. These files could not be used in Android as it is meant only for windows.
12. CMD is backward compatible. BAT is not backward compatible.
13. It is faster and more stable. It is not that fast and stable.
14. File names are longer in CMD File names are not that longer in BAT.

Last Updated : 03 Jan, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads