---------------------- MS-DOS v6.22 Help: CHDIR (CD) -----------------------
<Notes> <Examples>                                               <Index>
----------------------------------------------------------------------------

                                 CHDIR (CD)

Displays the name of the current directory or changes the current
directory.

Syntax

    CHDIR [drive:][path]

    CHDIR[..]

    CD [drive:][path]

    CD[..]

To display the current drive letter and directory name, use either of the
following syntax lines:

    CHDIR

    CD

Parameters

[drive:][path]
    Specifies the drive (if other than the current drive) and directory to
    which you want to change.

 ..
    Specifies that you want to change to the parent directory.

                                      ***

<Syntax> <Examples>
----------------------------------------------------------------------------

                                CHDIR--Notes

Changing to the root directory

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

    cd \

Using the current directory from a different drive

If you are working in the \PUBLIC\JONES directory on drive C and you change
to drive D, you can copy files to and from the \PUBLIC\JONES directory by
specifying only the drive letter C.

Changing the directory on another drive

You can change the current directory on another drive by specifying the
drive letter on the command line when you use CHDIR or CD.
                                      ***

<Syntax> <Notes>
----------------------------------------------------------------------------

                              CHDIR--Examples

Either of the following commands changes your current directory to the
directory named PRIMETIM:

    chdir \primetim

    cd \primetim

Suppose you have a directory named SPECIALS with a subdirectory named
SPONSORS. To change your current directory to \SPECIALS\SPONSORS, type the
following command:

    cd \specials\sponsors

Or, if your current directory is \SPECIALS, you can use the following
command to change to the \SPECIALS\SPONSORS directory:

    cd sponsors

To change from a subdirectory back to the parent directory, type the
following command:

    cd..

To display the name of the current directory, you can use CHDIR or CD
without a parameter. For example, if your current directory is \PUBLIC\JONES
on the disk in drive B, type CHDIR to see the following response:

    B:\PUBLIC\JONES

If you are working on drive D and you want to copy all files in the
\PUBLIC\JONES and \PUBLIC\LEWIS directories on drive C to the root directory
on drive D, type the following commands:

    chdir c:\public\jones
    copy c:*.* d:\
    chdir c:\public\lewis
    copy c:*.* d:\

If, instead, you want to copy all files in the \PUBLIC\JONES and
\PUBLIC\LEWIS directories to your current location on drive D, type the
following commands:

    chdir c:\public\jones
    copy c:*.* d:
    chdir c:\public\lewis
    copy c:*.* d:

For more information on copying files, see the <COPY> command.

                                      ***

----------------------------------------------------------------------------
<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005
Counter