我想要一个脚本来用这个输出写一个文件:
rem ===[A]==========[B]==========[C] # =========[D]==========[E]==========[F] # =========[G]==========[H]==========[I]
set "A1= " & set "B1= " & set "C1= " # & set "D1= " & set "E1= " & set "F1= " # & set "G1= " & set "H1=5" & set "I1= "
在这种情况下,我想使用 EnableDelayedExpansion
我写了这个脚本:
setlocal EnableDelayedExpansion
set file="test.bat"
echo rem ===[A]==========[B]==========[C] # =========[D]==========[E]==========[F] # =========[G]==========[H]==========[I] >> %file%
echo set "A1= " ^^& set "B1= " ^^& set "C1= " # ^^& set "D1= " ^^& set "E1= " ^^& set "F1= " # ^^& set "G1= " ^^& set "H1=5" ^^& set "I1= " >> %file%
但输出只有一行:
rem ===[A]==========[B]==========[C] # =========[D]==========[E]==========[F] # =========[G]==========[H]==========[I]
如何使用 EnableDelayedExpansion 使输出像我想要的那样?