Q. How to Changing the Directory in DOS?
You can change the directory. After changing the directory, the new directory becomes the default directory. For example, you change the directory to EXCEL in drive C. Now if you use any DOS command (including DIR) and you do not specify the drive or directory with the command, DOS will automatically use the C:\ EXCEL directory with the command. To change the directory, you can use the CHDIR or CD command, e.g.
CHDIR \ EXCEL
CD \ EXCEL
CD C:\ EXCEL
CD C:\ EXCEL\SALES
The first two commands try to select the EXCEL directory in the current drive. If the system prompt is C :>, C :\> or starts with 'C:' drive is the default drive. In that case, these commands will try to select the EXCEL directory at the root level in drive C. If the EXCEL directory exists in the default drive, DOS will select it. Otherwise, it will display the message - 'invalid directory'. The next command, i.e. CD C:\ EXCEL too tries to select the EXCEL directory in drive C. Notice that this command uses the complete the path, including the drive name. The last command tries to selects the SALES directory under the EXCEL directory from drive C. Remember that if you want to change the directory in a drive other that the default (current) drive, you must the specify the complete path, including the drive name (letter) with CHDIR or CD. For instance, if your screen displaying 'A :>', 'A :\>' or a similar prompt and you select the word directory in drive C, use any of the following commands.
CHDIR C:\WORD
CD C:\WORD
However, if you want to select the directory in the current drive, you may omit the drive name. After change the directory to WORD, if you use the DIR command, DOS displays the list of files from the WORD directory.
To select the root directory in the drive (regardless of the currently selected directory), you can use any of the following commands:
CHDIR \
CD \