How to SET a variable to the path of parent directory on windows?

前端 未结 3 1176
日久生厌
日久生厌 2020-12-30 02:59

Struggling with command line again, I have figure out that I can store the current working directory in a variable like so:

SET current=%cd%
<
3条回答
  •  无人及你
    2020-12-30 03:36

    Use

    pushd targetFolder
    set current=%cd%
    popd
    

    Pushd/popd maintain a stack of previously visited directories.

提交回复
热议问题