Attempting to detect a Microsoft Visual Studio installation
Setting environment for using Microsoft Visual Studio 2005 x86 tools.
Targeting Windows XP 32 DEBUG
\Microsoft was unexpected at this time.”
For example, this can occur on a 64-bit computer because the PATH variable typically contains "C:\Program Files (x86)" (the location for 32-bit applications).
Running the following script generates an error because the shell script interpreter misinterprets the parentheses in the expanded VAR variable as part of the IF/ELSE statement:
... was unexpected at this time.
When delayed expansion is disabled, (the default), the first processing step that happens in a statement is to expand all the environment variables (expansion at parse time). When it is enabled, the environment variable is not expanded until it is actually needed (expansion at execution time). With the delayed expansion enabled, the parentheses in the IF/ELSE statement are properly balanced with each other, even if any environment variable contains parentheses.