How to print current directory name via MS-DOS commands

DmitryBoyko picture DmitryBoyko · Aug 7, 2012 · Viewed 82.5k times · Source

I need to print current directory name after CD command.

Is it possible to do? Thanks!

echo off
echo. 
echo This batch program deletes some files  
echo. 

pause

cd "D:\Folder1\"  

pause 

Answer

hmjd picture hmjd · Aug 7, 2012

Just use cd with no arguments supplied. From cd /?:

Type CD without parameters to display the current drive and directory.