1
SET CurrDir=%CD% CD.. SET InstPath=%CD% CD %CurrDir%
2
pushd.. set parent=%cd% popd
参考:
https://msfn.org/board/topic/65204-how-to-get-parent-path-in-bat/