How to get the path of the batch script in Windows?

前端 未结 8 1330

I know that %0 contains the full path of the batch script, e.g. c:\\path\\to\\my\\file\\abc.bat

I would path to be equal to

8条回答
  •  长情又很酷
    2020-12-04 05:17

    %cd% will give you the path of the directory from where the script is running.

    Just run:

    echo %cd%
    

提交回复
热议问题