我想访问第二个批处理文件中更新的环境变量,该文件使用第一个批处理文件不断变化。
e.var 使用第一个批处理文件不断变化,但在启动第二个批处理文件后,我只得到一个分配给 E.variable 的值。
例如:
:start
setx ev=%random%
sleep 5s
goto start:
Run Code Online (Sandbox Code Playgroud)
:start
echo %ev%
sleep 10s
goto start:
Run Code Online (Sandbox Code Playgroud) batch ×1