Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
CHDIR--Examples
◄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.
♦