For changing the drive in cmd, we usually write the drive letter as follows:
E:
The drive will be changed to E drive,but the following behaviour of cmd is surpising to me:
C:\Users\Rohan>cd E:/java/java files/Applets
C:\Users\Rohan>E:
E:\JAVA\java files\Applets>dir
Volume in drive E is DISK1_VOL2
Volume Serial Number is 94AA-4876
Directory of E:\JAVA\java files\Applets
See the way the entire directory path changes, instead of just the drive by giving a cd command, preceding the drive letter.
Can anyone explain, how this happens?
Think of it as if every drive has its own current directory. So you can change each drive’s current directory separately, but you’ll always have one active drive selected.
If you change to another drive, its current directory is also made active. If you want a more consistent way of changing the drive and directory in one step, you can use the
CDcommand with the/Dswitch. Like this: