Nayana Adassuriya
Nayana Adassuriya

Reputation: 24766

What is "delayed environment variable expansion"

Is there someone to explain exactly what is delayed environment variable expansion in simple terms or point to a post that can understand. Here is my questions

Upvotes: 0

Views: 619

Answers (1)

user6017774
user6017774

Reputation:

%Var% is expanded when a line is read. As lines can have multiple commands, !var! is expanded when used. In MS-DOS !var! (accessed in script by %!var!%) is a legal variable name so you have to turn on a special mode to access. This is so MS-DOS batch files can run in CMD without editing.

Upvotes: 1

Related Questions