When was mkdir /D added?

Nov 2, 2009
247
5
Chile
www.farah.cl
Maaaaaaaaaaany years ago, I added a nice little batch to my toolset, "mc.bat" (mc.btm later on), that would make a directory and then change into it. I have discovered today that mkdir /D does just that. Gawd, I feel dumb.

But now I wonder, how many years have I been in this situation? Is the /D option a recent adition, or is it actually pretty old?
 

samintz

Scott Mintz
May 20, 2008
1,324
12
Solon, OH, USA
There was an example ALIAS named ND that was introduced way back in the 4DOS days that did the same thing.
I use these ALIAS's all the time:
Code:
nd=md %1 & cdd %1
in=pu %1 & %2$ & po
pu=pushd
po=popd
al=alias
 
May 20, 2008
9,199
60
Syracuse, NY, USA
There was an example ALIAS named ND that was introduced way back in the 4DOS days that did the same thing.
I use these ALIAS's all the time:
Code:
nd=md %1 & cdd %1
in=pu %1 & %2$ & po
pu=pushd
po=popd
al=alias
I remember the first one of those. It's from way, way back. I never found a use for directory stacks with more than one entry so ever since those days I've had an alias to go b(ack).
Code:
alias b cdd -
and one to go u(p).
Code:
alias u cd ..
 
Nov 2, 2009
247
5
Chile
www.farah.cl
Mine looks like this:
Code:
md /s %1 && %1\
... and yes, I continue to favor it over MD /D.
At first, mine was a simple
Code:
md & cd
. At some point during all these years, I decided to be able to make a directory and change into it even if I had neglected to give it a name, so I ended up with this:

Code:
@echo off
iff "%1"=="" then
  set U=%@unique[.]
  set N=%@filename[%U]
  del "%U" >nul
  mkdir "%N"
  if "%_?"=="0" cd %N
  unset U
  unset N
else
  mkdir %1
  if "%_?"=="0" cd %1
endiff
My memories about making this change are rather nebulous, so this stunt must have have been pulled between 2007 and 2010.
 
May 30, 2008
215
1
It's in v12 (2011?) and not in v11.
It's in v15 as well (as expected), but it's not included in the help file nor the command quick help, so understandably easy to miss!

I became aware of it with this thread. :)
 
Code:
alias b cdd -
and one to go u(p).
Code:
alias u cd ..
I've found it more intuitive to just use
Code:
alias -=*cd -
alias ..=*cd ..
alias ...=*cd ..\..
alias ....=*cd ..\..\..
alias \=*cd \
alias /=*cd \
alias .=echo %_CWD
alias ~=*cdd %TCCDIR%
rather than trying to remember mnemonics. For me, unless it's an OS function (like t for type), there are too many one letter apps I have already to dedicate a valuable letter to directory moves :-)
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,798
48
Albuquerque, NM
prospero.unm.edu
I've found it more intuitive to just use
Code:
alias -=*cd -
alias ..=*cd ..
alias ...=*cd ..\..
alias ....=*cd ..\..\..
alias \=*cd \
alias /=*cd \
alias .=echo %_CWD
alias ~=*cdd %TCCDIR%
rather than trying to remember mnemonics. For me, unless it's an OS function (like t for type), there are too many one letter apps I have already to dedicate a valuable letter to directory moves :-)
The first six will work even if you don't define an alias :cool: