I notice in most scripts, the two are usually in the same line as so:
SETLOCAL ENABLEDELAYEDEXPANSION
Are the two in fact separate commands and can be written on separate lines?
Will setting ENABLEDELAYEDEXPANSION have an adverse effect on a script if it is set on the first lines of the script and not disabled until the end of the script?
ENABLEDELAYEDEXPANSIONis a parameter passed to theSETLOCALcommand (look atsetlocal /?)Its effect lives for the duration of the script, or an
ENDLOCAL:In particular, this means that if you use
SETLOCAL ENABLEDELAYEDEXPANSIONin a script, any environment variable changes are lost at the end of it unless you take special measures.