I'm still struggling with this:
Trying to build a variable composed from commands like:
Code: Select all
set "$?=echo.This &echo.works &set /a $error = 0"
Meaning I can't use immediate expansion like:
Code: Select all
%$?%
I tried something like:
Code: Select all
for /f "usebackq" %%! in ( `!$?!` ) do %%!
Code: Select all
@echo off &SetLocal EnableExtensions EnableDelayedExpansion
set ^"@macro=(
set "$?=echo.This &echo.works &set /a $error = 0"
for /f "usebackq" %%^^^! in ( `^^^!$?^^^!` ) do %%^!
)"
%@macro%
pause
EndLocal &exit /b 0