Chdir--Examples
Either of the following commands changes your current directory to the
directory named REPORTS:
chdir \reports
cd \reports
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 next higher 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:
More Information About Chdir
Chdir--Notes
Chdir