Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print current directory name via MS-DOS commands

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  
like image 298
Friend Avatar asked Aug 07 '12 14:08

Friend


People also ask

How do I print the current directory in DOS?

MS-DOS and Windows command line current directory To list the files in the current directory use the dir command, and if you want to change the current directory, use the cd command. You can use the chdir command by itself to print the current directory in MS-DOS and the Windows command line.

How do I print a directory in command prompt?

In a Windows command prompt, chdir or cd will print the full path of the current working directory in the console.

How do I find my current directory name?

To determine the exact location of the current directory at a shell prompt and type the command pwd. This example shows that you are in the user sam's directory, which is in the /home/ directory. The command pwd stands for print working directory.

What is the command to show current directory in?

Use the pwd command to write to standard output the full path name of your current directory (from the /(root) directory). All directories are separated by a slash (/).


1 Answers

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

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

like image 114
hmjd Avatar answered Sep 28 '22 06:09

hmjd