I had a problem with set not working in a batch file; it took a while to distil the problem; at first I thought it was to do with subroutine calls...
set
The sc
User delayed expansion and ! instead of %
@echo off setlocal enableextensions enabledelayedexpansion set a=aaa echo a = "%a%" ( set b=bbb echo b = "!b!" )