38

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 
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
NoWar
  • 36,338
  • 80
  • 323
  • 498

1 Answers1

76

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

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

hmjd
  • 120,187
  • 20
  • 207
  • 252
  • 9
    And if you're trying to do more with the current directory as a value than simply printing it to console, use `%cd%` to access the environment variable. – kayleeFrye_onDeck Feb 04 '16 at 02:04