Arrays, linked lists and other data structures in cmd.exe (batch) script

Ok. I’ll try to be as clear as possible to not be misunderstood… In Windows Batch files a variable name should begin with a letter and may include any valid character, where valid characters are: #$'()*+,-.?@[]_`{}~ besides letters and digits. This means that from the cmd.exe point of view, SET NORMAL_NAME=123 is exactly the same … Read more

Variables are not behaving as expected

You are not the first, who fell into the famous “delayed expansion trap” (and you won’t be the last). You need delayed expansion if you want to use a variable, that you changed in the same block (a block is a series of commands within parentheses (and )). Delayed variables are referenced with !var! instead … Read more

How to read a text file line by line and modify every line using a batch file?

The Windows command processor is designed for running commands and applications. It is not designed for editing text files. Really every scripting or programming language would be better for this task than a batch file executed by Windows command processor cmd.exe. For your simple text file example with using a character encoding with one byte … Read more