Cd command in Windows

The cd command displays the name or changes the current directory. If used only with a drive letter (eg cd C :), the cd command displays the name of the current directory in the specified drive. If used without parameters, the cd command will show the current drive and directory.

Note : This command is the same as the chdir command.

Syntax

 cd [/ d] [:] [] 
cd [.]
chdir [/ d] [:] []
chdir [.]

Parameters

ParameterDescription / d Change the drive as well as the current directory for a drive. : Specify the drive to display or change (if different from the current drive). Specify the path to the folder you want to display or change. [.] Specifies that you want to change the root directory. /? Show help at the command prompt.

Note

If the command extension is enabled, the following conditions will apply to the cd command:

  1. The current directory string is converted to use the same case with the name on the drive. For example: cd C: TEMP will put the current directory into C: Temp if that happens on the drive.
  2. Spaces are not considered delimiters, so the path may contain spaces without quotes. For example:
 cd usernameprogramsstart menu 

Like:

 cd "usernameprogramsstart menu" 

However, quotes are required, if the extension is disabled.

To turn off the extension, enter:

 cmd / e: off 

For example

The root directory is the top part of the directory hierarchy for a drive. To return to the root directory, type:

 CD 

To change the default folder on the drive (the folder is different from the folder you are accessing), enter:

 cd [: []] 

To verify changes to the directory, enter:

 cd [:] 

See more:

  1. Summary of DOS commands in MS-DOS
  2. The autochk command in Windows
  3. The atmadm command in Windows
5 ★ | 1 Vote

May be interested

  • Instructions for using Command PromptInstructions for using Command Prompt
    deep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
  • Rd command in WindowsRd command in Windows
    the rd command helps delete a directory
  • Cmd command in WindowsCmd command in Windows
    the cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
  • How to use the command history function in Command PromptHow to use the command history function in Command Prompt
    command prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
  • The sfc command in WindowsThe sfc command in Windows
    (applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
  • Reg command copy in WindowsReg command copy in Windows
    to copy an entry to the location specified on the local pc or the remote computer we will use the reg copy command. to learn more about how to use the reg copy command, you can track the syntax, explain the command parameters and the example tipsmake.com has compiled below.
  • Fc command in WindowsFc command in Windows
    the fc command compares two files or a collection of files and displays the differences between them.
  • The echo command in WindowsThe echo command in Windows
    the echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
  • Xcopy command in WindowsXcopy command in Windows
    the xcopy command is a command prompt command used to copy one or more files or folders from one location to another. with many options and the ability to copy entire directories, the xcopy command is similar to, but much more powerful, than the copy command.
  • The cacls command in WindowsThe cacls command in Windows
    the cacls command displays or modifies an arbitrary access control list (dacl) on the specified file. the command applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012.