DEV Community

Cover image for Understanding Delayed Expansion in Batch CMD
Islam NEGM
Islam NEGM

Posted on

Understanding Delayed Expansion in Batch CMD

I always try to avoid writing Batch script files as it's really tedious to maintain them in contrary of other scripting languages like BASH for example.

Crying man meme

But sometimes it's unavoidable to deal with some Batch code. That's why it's really important to understand some concepts specially the "Delayed Expansion" concept in batch files.

This is a good tutorial of understanding the concept of "Delayed Expansion" in batch files. This is a good concept to know when writing a Batch file that is including relatively not simple code (for example if, for, ..etc) statements.

Enjoy,

https://ss64.com/nt/delayedexpansion.html

Discussion (0)