千家信息网

windows常用命令(延迟扩展篇)

发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,复合语句中:setlocal EnableDelayedExpansionset a=1 && echo !a!for循环中:setlocal EnableDelayedExpansionfo
千家信息网最后更新 2025年02月03日windows常用命令(延迟扩展篇)
  1. 复合语句中:
    setlocal EnableDelayedExpansionset  a=1  &&  echo  !a!
  2. for循环中:
    setlocal EnableDelayedExpansionfor  /l  %%i  in  (1,2,5)  do  (    set  /a  a=%%i    echo  !a!)
0