Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

When was mkdir /D added?

Nov
339
7
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?
 
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
 
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 ..
 
There was an example ALIAS named ND that was introduced way back in the 4DOS days that did the same thing.
Code:
nd=md %1 & cdd %1

Mine looks like this:
Code:
md /s %1 && %1\
... and yes, I continue to favor it over MD /D.
 
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.
 
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. :)
 
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. :)
It's in both places here!

upload_2016-9-6_9-6-28.png


upload_2016-9-6_9-8-31.png
 
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 :-)
 
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:
 
Back
Top