我想简单地将一个变量从批处理传递给一个文件,然后用该变量执行该文件。我怎样才能做到这一点?
批次:
@echo off
set /p var=Name:
::Then pass %var% to a file and execute it.
for /f "delims=" %%L in (name.txt) do %%L
文件:
echo Your name must be %var%.
答案 0 :(得分:0)
for /f "delims=" %%L in (name.txt) do call %%L
显示预期结果本来是个想法。