At first I'd like to say that I do understand the purpose of the /D
switch for the Windows Command Prompt cd
command. I'm just curious why it works this way, and not other. As we all know, it does the following:
Use the /D switch to change current drive in addition to changing current directory for a drive.
But every single time I enter (for example) cd F:
, it's obvious enough that I would like to change the drive. That is why I think this switch is redundant by itself.
So what's the point of explicitly setting this switch? Why it isn't implied by default?
Short answer: Because DOS behaved this way, and cmd
tries to mimic DOS.
Originally, DOS had a 'current director' for each drive, so if you write cd d:\folder
you change the current directory for the D
drive.
You can read more about this here: http://blogs.msdn.com/b/oldnewthing/archive/2010/10/11/10073890.aspx
You have to remember, DOS dates back to before we even had mice to cut and paste text and when screens were 80x25 text. Extra typing, particularly if you had to remember something and type it in later, was extremely painful. Now imagine trying to work on more than one drive. With only one current directory, you'd have to fully specify directories on drives other than the current drive. That would require writing down the paths on the other drives because they wouldn't stay on screen. Ouch.
So instead you could do:
dir a: <- See what dir I need
cd a:foo <- This one
dir a: <- See what file
dir b: <- See what dir I need
cd b:bar <- This one
dir b: <- See what file
a:program b:data <- use them both
Otherwise, it'd be:
dir a: <- See what dir I need
cd a:foo <- This one
dir a: <- See what file (lots of scroll)
dir b:\ <- See what dir I need (scroll)
cd b:\bar <- This one
dir b: <- See what file (lots of scroll)
a:\foo\program b:data <- use them both (had to remember "foo")
Now imagine it's more than one directory deep.
And now, imagine if the program doesn't support subdirectories and you need to pass two paths to it on two different drives.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With