You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2022. It is now read-only.
REM `set /p "var="`: can't use `echo`, for `echo` won't use stdin.
REM `cmd /v:on`: to EnableDelayedExpansion. can't use `SETLOCAL EnableDelayedExpansion`, for parentheses.
REM "When DelayedExpansion is used inside a code block (one or several commands grouped between parentheses) whose output is Piped, the variable expansion will be skipped"
REM see: [EnableDelayedExpansion - Windows CMD - SS64.com](https://ss64.com/nt/delayedexpansion.html),
REM [batch file - Why does delayed expansion fail when inside a piped block of code? - Stack Overflow](https://stackoverflow.com/questions/8192318/why-does-delayed-expansion-fail-when-inside-a-piped-block-of-code)
REM busy (`cmd`?), and can capture only one line
REM echo %time% | (@set /p "var=" & set var) >>test.txt
REM result contain `var=` prefix
REM echo %time% >>test.txt
REM OK
REM echo %time% >nul >>test.txt
REM output file get value. wiil change redirect set ealier `>nul`.
REM >>test.txt echo %time% >nul
REM won't output to file, neither to 'stdout', but to 'nul', as expected.