>>706
パイプの動作が原因だろう
パイプの右側は子タスクでの実行となる(おそらくは)
メインタスクに環境を引き継がないんだと思う

echo "a"|for /f %%i in ('find "a"') do set x=OK
echo.%x%
これで%x%には値が入らない

echo "a"|find "a"&set x=OK
なら%x%にはOKが入るが
echo "a"|(find "a"&set x=OK)
では%x%にはOKが入らない