CD - Change the current directory
Purpose: Display or change the current directory.
Format: CD [/N] [ path | - ]
or
CHDIR [/N] [ path | - ]
path : The directory to change to, including an optional
drive name.
/N(o extended search)
See also: CDD, MD, PUSHD, RD, CDPATH, and Directory Navigation.
Usage
CD and CHDIR are synonyms. You can use either one.
CD lets you navigate through a drive's structure by changing the current
working directory. If you enter CD and a directory name, the named
directory becomes the new current directory. For example, to change to
the subdirectory C:\FINANCE\MYFILES :
[c:\] cd \finance\myfiles
[c:\finance\myfiles]
Every disk drive on the system has its own current directory. Specifying
both a drive and a directory in the CD command will change the current
directory on the specified drive, but will not change the default drive.
For example, to change the default directory on drive A:
[c:\] cd a:\utility
[c:\]
Notice that this command does not change to drive A:. Use the CDD
command to change the current drive and directory at the same time.
When you use CD to change to a directory on an HPFS drive, you must quote
the path name if it contains whitespace or special characters. See File
Names and File Systems for additional details.
You can change to the parent directory with CD ..; you can also go up one
additional directory level with each additional [.]. For example, CD ....
will go up three levels in the directory tree (see Extended Parent
Directory Names). You can move to a sibling directory -- one that
branches from the same parent directory as the current subdirectory --
with a command like CD ..\newdir.
If you enter CD with no argument or with only a disk drive name, it will
display the current directory on the default or named drive.
If CD cannot change to the directory you have specified it will attempt
to search the CDPATH and the extended directory search database in order
to find a matching directory and switch to it. You can use wildcards in
the path to force an extended directory search. See the section on
Directory Navigation for complete details on these and other directory
navigation features. To disable extended directory searches for the
current command (e.g. in a batch file) see the /N option below.
CD saves the current directory before changing to a new directory. You
can switch back to the previous directory by entering CD - (there must be
a space between the CD command and the hyphen). You can switch back and
forth between two directories by repeatedly entering CD -. The saved
directory is the same for both the CD and CDD commands. Drive changes
and automatic directory changes also modify the saved directory, so you
can use CD - to return to a directory that you exited with an automatic
directory change.
Directory changes made with CD are also recorded in the directory history
list and can be displayed in the directory history window, which allows
you to return quickly to a recently-used directory.
CD never changes the default drive. If you change directories on one
drive, switch to another drive, and then enter CD -, the directory will
be restored on the first drive but the current drive will not be changed.
Option
/N: (No extended search) This option prevents CD from searching
the extended directory search database or displaying the
related popup window. If /N is used and the specified
directory is not found via other methods (i.e. without an
extended search), CD will display an error. This option is
primarily intended for use in batch files where you do not
want CD to use "fuzzy" directory searching or display an
extended search popup window.
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs