find path of current folder - cmd

后端 未结 3 1771
既然无缘
既然无缘 2020-11-27 05:36

I use this script to find out the current folder with its .bat file:

for /f %%i in (\"%0\") do set curpath=%%~dpi 
echo  %curpath% 

it does

3条回答
  •  遥遥无期
    2020-11-27 05:55

    Use This Code

    @echo off
    :: Get the current directory
    
    for /f "tokens=* delims=/" %%A in ('cd') do set CURRENT_DIR=%%A
    
    echo CURRENT_DIR%%A 
    

    (echo this To confirm this code works fine)

提交回复
热议问题