setlocal enabledelayedexpansion只能在批处理文件中工作吗?如何setlocal enabledelayedexpansion在cmd提示符下使用?
您可以使用以下命令在命令提示符中启用延迟扩展cmd /V:ON
从cmd /?:
/V:ON Enable delayed environment variable expansion using ! as the
delimiter. For example, /V:ON would allow !var! to expand the
variable var at execution time. The var syntax expands variables
at input time, which is quite a different thing when inside of a FOR
loop.
Run Code Online (Sandbox Code Playgroud)