I am cd ing to a directory inside a windows .cmd file, but this f开发者_如何学运维ile has various return points,
how do I make return to the original directory without saving the original directory and returning to it explicitly at every return point in the script.
I think is has something to do with scope....?
Use PUSHD and POPD.
C:
CD \
PUSHD C:\Windows
POPD
Just add another level of indirection. Instead of original_script.cmd
, run this:
PUSHD
CALL original_script.cmd
POPD
精彩评论