Creating scoped variables in windows command line

command line Here is how we can create an environment variables that will be scoped to a specific block in a batch file:

Example:

@echo Off
SETLOCAL
SET A="test"
echo %A%
ENDLOCAL
echo %A%

The word "test" is printed once.

Post a Comment

Previous Post Next Post