Windows shell command to get the full path to the current directory?

前端 未结 14 1750
一向
一向 2020-11-30 17:51

Is there a Windows command line command that I can use to get the full path to the current working directory?

Also, how can I store this path inside a variable used

14条回答
  •  忘掉有多难
    2020-11-30 18:24

    @echo off
    for /f "usebackq tokens=*" %%x in (`chdir`) do set var=%%x
    echo The currenct directory is: %var%
    

    But, of course, gmaran23's answer is the much easier one.

提交回复
热议问题