@echo off
set VAR=after
if "%VAR%" == "before" (
set VAR=after
if "!VAR!" == "after" @echo If you see this, it worked
)
@echo off
set VAR=before
if "%VAR%" == "before" (
set VAR=after
if "!VAR!" == "after" @echo If you see this, it worked
)
按理说下面一个 应该显示: If you see this, it worked
但是我这里两个什么都不显示。
set LIST=
for %i in (*) do set LIST=!LIST! %i
echo %LIST%
应该返回全部文件啊
我这却返回 !LIST! q.bat ::q.bat 是最后一个文件
set LIST=
for %i in (*) do set LIST=%LIST% %i
echo %LIST%
返回q.bat
set VAR=after
if "%VAR%" == "before" (
set VAR=after
if "!VAR!" == "after" @echo If you see this, it worked
)
@echo off
set VAR=before
if "%VAR%" == "before" (
set VAR=after
if "!VAR!" == "after" @echo If you see this, it worked
)
按理说下面一个 应该显示: If you see this, it worked
但是我这里两个什么都不显示。
set LIST=
for %i in (*) do set LIST=!LIST! %i
echo %LIST%
应该返回全部文件啊
我这却返回 !LIST! q.bat ::q.bat 是最后一个文件
set LIST=
for %i in (*) do set LIST=%LIST% %i
echo %LIST%
返回q.bat
