The CHDIR command, also known as CD, is a command-line utility in Windows CMD used to display the name of or change the current directory. It is a fundamental tool for navigating and managing file system paths within the command prompt environment. CHDIR is particularly useful in scripting, automation of tasks, and batch processing where changing the working directory is required.


The basic syntax for CHDIR is:

CHDIR [drive:][path]
CHDIR [..]
CD [drive:][path]
CD [..]


  • [drive:] (Optional): Specifies the drive letter followed by a colon.
  • [path] (Optional): Specifies the directory path to change to.
  • [..] (Optional): Specifies that you want to move up one level in the directory tree (same as the parent directory).

To display the current directory:


or simply:



CHDIR does not include many options or flags; its functionality is straightforward:

  • /D Change the current drive in addition to changing the current directory for a drive.


  1. Display the Current Directory:
    C:\Users\JohnDoe> CHDIR
  2. Change to a Specific Directory:
    C:\Users> CD JohnDoe\Documents
  3. Change to the Parent Directory:
    C:\Users\JohnDoe\Documents> CD ..
  4. Change Drive and Directory:
    C:\> CD /D D:\Games

Common Issues

  • Error: “The system cannot find the path specified.”:
    Ensure the path you are trying to change to exists. Typos or incorrect drive letters can cause this error.
  • Using CD without specifying a drive does not change the drive:
    In situations where you are working across multiple drives, remember to use the /D flag to change the current working drive along with the directory.


CHDIR can be integrated with other CMD commands to perform more complex tasks:

  • Combining with DIR to list contents of a specified directory:
    CD C:\Example & DIR
  • Using in batch scripts to ensure commands run in the correct directory:
    CD /D C:\RequiredDirectory
    START myapplication.exe
  • DIR – Displays a list of files and subdirectories in a directory.
  • MKDIR (or MD) – Creates a directory.
  • RMDIR (or RD) – Removes a directory.

For further reading on CHDIR and related commands, the Microsoft official documentation provides in-depth coverage and is an essential resource for Windows CMD users.