Get current batchfile directory

Firstly, I saw this topic but I couldn’t understand that.

Question :

There is a batch file in D:\path\to\file.bat with following content :

echo %cd%
pause

Output is :

C:\

It must be D:\path\to

What am I doing wrong?

4 Answers
4

Leave a Comment