Long before the advent of modern multi-tasking operating systems with powerful capabilities and an attractive interface, MS-DOS existed as the main OS in the computer world. Very simple and practically “weightless” by today's standards, it coped well not only with the organization of the man-machine dialogue, but also with a wide range of other tasks that were required to be performed by the computer of the time. Already at that time, the computer had powerful capabilities, he knew what a file extension was and took it into account in its work.
Almost all subsequent Microsoft Windows products retained in their work the operating principles laid down by the OS, their predecessor. The user still retained the right to control the computer from the so-called command line, and displaying the file extension allowed not only to determine their purpose, but also to help the machine cope with their processing.
Following the chain Start => Run => Run the program in the window that opens, type the cmd command and click OK. After the perfect manipulations, we are given the opportunity to work in command line mode. Despite the seemingly archaic nature of this method of communicating with a computer and a not very attractive interface, this mode allows you to carry out a number of useful operations, without which it would be difficult for a professional user to do.
One of the options for using the command line functionality is the ability to use batch files. The list of commands that the computer understands as text saved in a bat-file allows you to automate a huge number of tasks for processing them. For a number of technical writers, such a need arises from time to time. Of course, the task of single processing an unlimited number of files can be performed using DITA or DocBook technologies. You can also process each of them as a separate command, which you manually “hammer” into execution. This method will not only take a lot of time, but can also lead to a number of random errors (typos of the operator), which are almost impossible to determine.
Using a bat-file, the user uses it only as an option from all the processing tools allowed in the OS. Both in MS-DOS and in the subsequent Microsoft Windows products, this method is the simplest way to automate the process of processing files (directories). An alternative to this method is used with the 98th version of Windows Script (ing) Host. You can program these operations in Python, Perl, or Ruby. But it takes time to master these powerful tools.
The command batch file for writing does not require a long study of the principles of MS-DOS. After examining several available commands built into the command processor, the rules for writing them, and some of the nuances of writing, you can safely get to work.
Of course, it will take time to study the complete reference book or tutorial on the commands of the MS-DOS operating system, but the whole charm in the process of writing batch files is that you can start this work with a minimum set of knowledge, subsequently expanding it if necessary. To write a bat-file, you do not need complex compilers and debuggers - a simple notepad is enough.
Moreover, each line is a command and the entire list is executed sequentially. In addition, when executing the entire list of commands, conditions can be checked, options can be selected, variables can be used, mass file processing and other tools provided for by the instruction for the command processor can be used.
Studied and tested over the long years of existence of MS-DOS tools are widely used to this day. And although in its pure form this operating system can no longer be found in the body of cutting-edge platforms of the latest generations, they all reserve the right to use the command line functionality in its original form.