Often times you might want to write Batch file scripts to automate system administration tasks, and in addition to that you might want to pass configuration files to your Batch scripts.
This article, inspired by the Batchography book, shows you how to parse INI files and retrieve values from a given section and key.
Quick background
An INI file (or initialization file) is a text file that has the following format:
; comment [section_name1] Key1Name=Value1 . . . [section_name2] Key1Name=Value1 Key2Name=Value2 . . .
In the MS Windows operating system, a C/C++ programmer can read/write values from the INI files using the following APIs:
But can we do the same using Batch files?
Yes and in the next section, we show you how to read values from the INI file. Continue reading “Batchography: Parsing INI files from a Batch file”