A
A
Andrey Shiryaev2014-05-16 12:20:48
cmd/bat
Andrey Shiryaev, 2014-05-16 12:20:48

How to get the name of the directory where the bat file is located?

Hello.
Tell me how to get the name of the directory in which the bat file is located?
cd - возвращает полный путь
And I would like to find out only the name.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Shiryaev, 2014-05-16
@Claud

I found the solution myself.

for %%a in (".") do set CURRENT_DIR_NAME=%%~na
echo %CURRENT_DIR_NAME%

K
Konkase, 2014-05-16
@Konkase

echo %cd%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question