Should I always put setlocal enableDelayedExpansion
at the start a batch script, even when I don't need it?
Does it have any impact on performance, or will it cause any problem?
Should I always put setlocal enableDelayedExpansion
at the start a batch script, even when I don't need it?
Does it have any impact on performance, or will it cause any problem?
I enable delayed expansion nearly always at the beginning of any batch file.
Because it has two main advantages:
!varname!
is evaluated when the expression is executed, not when it is parsed, like percent expansion, this avoid many problemsThe only drawback is the handling of exclamation marks itself.
But even that can be solved with some glue code