## In batch file, use double percent %% prefix for the loop variable
@for /f "tokens=1-2 delims= " %%a in ('Date /T') do set SomeVar=%%a
echo "%SomeVar%"
## on command prompt, use single percent % prefix for the loop variable
@for /f "tokens=1-2 delims= " %a in ('Date /T') do set SomeVar=%a
echo "%SomeVar%"
|