How to print current directory name via MS-DOS commands
86,299
Just use cd
with no arguments supplied. From cd /?
:
Type CD without parameters to display the current drive and directory.
Comments
-
NoWar almost 4 years
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
-
kayleeFrye_onDeck over 8 yearsAnd 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.