Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在 cd 到 windows .cmd 文件中的一个目录,但是这个文件有各种返回点,
如何返回原始目录而不保存原始目录并在脚本中的每个返回点显式返回它。
我认为这与范围有关....?
使用 PUSHD 和 POPD。
C: CD \ PUSHD C:\Windows POPD
只需添加另一个间接级别。而不是original_script.cmd,运行这个:
original_script.cmd
PUSHD CALL original_script.cmd POPD