Chdir (CD) displays the name of the current directory or changes the current folder

Time:2021-7-29

Chdir (Cd)
Displays the name of the current directory, or changes the current folder. Use with only one drive letter (for example, chdir)   C: ), then   chdir   Displays the current drive name and folder. Used without parameters, chdir   Displays the current drive and directory.

grammar
chdir [[/d] [Drive:][Path] [..]] [[/d] [Drive:][Path] [..]]

cd [[/d] [Drive:][Path] [..]] [[/d] [Drive:][Path] [..]]

parameter
/d 
Change the current drive or the current directory of the drive.  
[drive:][Path] 
Specify the drive (if not the current drive) and directory to change to.  
[..] 
Indicates that you want to change to the parent folder.  
/? 
Displays help at the command prompt.  
notes
Using command extensions  
If command extension is enabled (that is, by default), the current directory path uses the same uppercase or lowercase folder name format to match the folder names exactly as they appear on the hard disk. For example, if the folder name on the hard disk is   C: \ temp, then   CD   C:\TEMP   Sets the current directory to   C: \ temp, which matches the folder name format of the folder on the hard disk.

To disable command extensions for a special procedure, type:

cmd e:off

When command extension is disabled, chdir   Spaces are not treated as delimiters. In this way, you don’t have to  [ Path]   In quotation marks, you can change to the subdirectory name with spaces. For example, the following path can be changed to  \ Start   menu   Subdirectories:

cd \winnt\profiles\username\programs\start menu

For more information on enabling and disabling command extensions, see in   cmd。

Change to root  
The root directory is the top level of the drive’s directory tree. To return to the root directory, type:  

cd\

Change the default directory on a drive from another drive  
To change the default directory on a drive from your drive, type one of the following commands:

chdir [Drive:\[directory]]

cd [Drive:\[directory]]

To verify the changes made to the directory, type one of the following commands:

chdir [Drive:]

cd [Drive:]

In the recovery console, a with different parameters is provided   chdir   Command.  
example
If you use with a drive letter, then   chdir   The current directory for the drive is displayed. For example, when   C:\Temp   Type at the directory prompt   cd   c: , the following information is displayed:

C:\Temp

To change the current directory to a directory named   Reports   You can type one of the following commands:  

chdir \reports

cd \reports 

To change the current directory to  \ Specials\Sponsors   Subdirectory, you can type:  

cd \specials\sponsors

Or, if your current directory is  \ Specials, you can type the following command to change to  \ Specials\Sponsors   Subdirectories:  

cd sponsor

To change from a subdirectory to its parent directory, type:  

cd ..

To display the name of the current directory, you can use the name without parameters   chdir   or   cd   Command. For example, if the current directory is   B   On drive  \ Public \ Jones, type   chdir   The following will be displayed:  

B:\Public\Jones 

To be in   D   Work on the drive and want to   C   Plate  \ Public\Jones   and  \ Public\Lewis   Copy all files in the directory to   D   Under the root directory of the disk, please enter:  

chdir c:\public\jones 

copy c:*.* d:\ 

chdir c:\public\lewis 

copy c:*.* d:\ 

If you want to  \ Public\Jones   and  \ Public\Lewis   Copy all files in the directory to the drive   D   To the current location on, type:  

chdir c:\public\jones 

copy c:*.* d: 

chdir c:\public\lewis 

copy c:*.* d: 

XOX