CD or CHDIR
Change Directory - Select a Folder (and drive). Also known as CHDIR.
CD [/D] [drive:][path]
/D : change the current DRIVE in addition to changing folder.
To change to the parent directory.
To change to the grant-parent directory.
To change to the ROOT directory.
To display the current directory in the specified drive.
To display the current drive and directory.
Moving down the folder tree with a full path reference to the ROOT folder...
C:\winnt> CD \winnt\java
Moving down the folder tree with a reference RELATIVE to the current folder...
C:\winnt> CD java
Moving up and down the folder tree in one command...
C:\winnt\java> CD ..\system32
If Command Extensions are enabled the CD command is enhanced as follows:
1) The current directory string is converted to use the correct CASE. So CD C:\wiNnt would actually set the current directory to C:\Winnt
2) CD does not treat spaces as delimiters, so it is possible to CD into a subfolder name that contains a space without surrounding the name with quotes.
cd \My folder
is the same as:
cd "\My folder"
3) An asterisk can be used to complete a folder name e.g. from C:\
will move to
This allows changing current folder by entering part of the path and pressing TAB
C:> CD Prog [PRESS TAB]
Will go to C:\Program Files\
Tab Completion is disabled by default, it has been known to create difficulty when using a batch script to process text files that contain TAB characters. Tab Completion is turned on by setting the registry value shown below
Changing the Current drive
simply enter the drive letter followed by a colon
To change drive and directory at the same time, use CD with the /D switch
C:> cd /D E:\utils
About the Author
FortyPoundHead has posted a total of 1974 articles.
Comments On This Post
No comments on this post yet!
Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.
Or you can drop a note to the administrators if you're not sure where you should post.