
Batch Script, Microsoft's scripting language, has been with the average Windows systems administrator since the early days of home and business computing, more precisely since MS-DOS, and it really was something almost mandatory for everyone who wanted to learn how to use systems Windows. But, currently, the scenario has changed, and companies, in general, no longer depend on Batch, although it is still one of the system's native tools. But is it still worth learning this archaic scripting language?
Firstly, we have to make it very clear that, even with the most outdated technologies, there will still be cases in which it can be useful to use, such as when administering legacy systems or making any changes to a standard Windows installation (without internet or anything else). , so the question is more whether it is worth the effort than whether it is of any use. Furthermore, I will limit myself to discussions about the Windows platform, without focusing on Unix systems or things that do not necessarily have any relation to the topic.
Lack of practical examples
The bulk of Batch Script's features do not have good examples, so you are restricted to documentation ( which doesn't have as many practical examples as would be ideal). Furthermore, most of the examples come from the MS-DOS and PC-DOS era, and may have discrepancies in both operation and syntax. Furthermore, the language syntax itself is not very intuitive for users of more modern scripting languages, such as Python, and does not support many data types, which brings us to the second problem.
The language is outdated
The bulk of the language's functions, such as loops or functions, use a GOTO-based syntax and separate files. Of course, terminal languages usually don't propose this, but even the Shell Script language has these functions. Furthermore, the data types within the language are few, and do not accurately reproduce the needs of a scripting language that can be easily used.
For example, what will you do when you have to use floating point in numbers? What about when you have to create a function to perform certain functions in the code? What if you have to create a key-attribute vector or an object? You'll see that you can use other languages.
Powershell
New versions of Windows aim to be completely compatible with Powershell and can even use it as the system's main shell. It is able to compensate for Batch Script's flaws and bring a modern approach to the Windows terminal. However, this also highlights the fact that even Microsoft itself is moving away from Batch Script, just as it previously did with VBScript.
Python
Python also enters this dispute, being a modern language, easy to use and you can even call Batch commands within a Python script. Furthermore, the language still maintains a much wider range of functions than Batch, such as RegEx support, and a package manager with all kinds of interesting utilities. Other than that, there is still a huge amount of examples and tutorials about the language and its varied uses, from managing Windows registries to creating web servers and tools of all types.
But, being the devil's advocate...
Being a main language was never the intention of Batch Script, but rather to perform small tedious tasks in a simple and practical way, and, although it doesn't have the same features as Shell Script, it fulfills its purpose well. Furthermore, it is an easy and simple language, which can be learned in a single day, and mastered in its entirety in less than a week (largely due to the lack of advanced resources, but also because it is actually a simpler language).
It was not created with the aim of creating complex graphic screens, but rather to call pre-installed resources in the system in a simple and practical way, and have its range of resources expanded. Furthermore, the evolution of Windows itself has always prioritized graphical interfaces to the detriment of interfaces via the command line, which explains why it has not evolved as much as other languages of this type, such as Shell Script.
So, when you always need to execute those three or four commands successively, you can use Batch Script for that, and create specific files to perform these actions, such as assembling the .jar file of a Java program, cleaning the cache of a project, installing certain dependencies, changing specific registries to perform certain functions, among others.
Conclusion
Although Batch Script is slowly falling into disuse, it is still an extremely useful tool for managing resources, especially for simple functions, such as executing sequential commands or specific tasks. Even so, it is still important to keep in mind that this language will not be your primary language (unless you administer a legacy server running MS-DOS or PC-DOS), but rather a complement for when you are working on Windows systems. This way, you can get the most out of your system in a simple and practical way.
So, if your goal is to choose a main language or opt for a multipurpose tool, Batch Script probably won't be worth the effort in learning, while other languages, such as Python and JavaScript, will be more useful. However, if your goal is to be a systems administrator specializing in Windows, or even if you intend to use Windows as your primary operating system as a programmer, it will probably be beneficial to learn.
Anyway, if you have absolutely nothing to do, it doesn't hurt to learn an extra tool, after all, you can never have too much knowledge, right? Yet another tool with such great historical importance, and such a vast number of possible applications.
