FWIW,

I like the CD utility in the library here a lot, but sometimes the search doesn't do quite what I 
want. For example I have a directory where Visual Basic is stored: "C:\VB" 
There are many utilities and third party addons that have directory names like "VBDEMO" and so on.
Using CD takes me to the first path with the substring "vb" anywhere in it, when what i would like
to do is go to the vb directory. One way to do this, if your directories don't change much, is to
rearrange the cdd.ini file so that the directory "C:\VB" is before any other path with "vb" in it.
If this is a hassle, another way is to use this modification:

At line 23 of refresh.btm, modify the line by changing

       echo %_cwd>>! %_f
		TO
       echo %_cwd~>>! %_f     

this will simply append a "~" to the end of each path in cdd.ini so that if you type a full directory
name as the cd argument, you will go there regardless of whether there is another part of a path
with the same name earlier in cdd.ini.


Then substitute the following for the cd alias:


CD*D=*set _cdd=%1^if .%1 eq . *set _cdd=%_cd^iff not isdir %_cdd\. then^
	ffind /kmt"\%1~" c:\cdd.ini>!%temp\%[_pid]cdd^if "%_?" != "0"   ffind /kmt"%1" c:\cdd.ini>!%temp\%[_pid]cdd^
	*set _cdd=%@word[0,%@line[%temp\%[_pid]cdd,0]]^*set _cddlen=%@dec[%@len[%_cdd]]^
	iff "%@substr[%_cdd,%_cddlen,1]" == "~" then^*set _cdd=%@substr[%_cdd,0,%_cddlen]^endiff^endiff^
	iff .%_cdd eq . then^*beep^echo %_cwd^else^*set _cd=%_cwd^*set _go=%1^*cdd %@word[0,%_cdd]^
	iff .%2 ne . then^%2&^endiff^endiff


The idea is to ffind for end directories exactly matching the CD argument, and then do a less restrictive ffind if the first one fails. 
The test is: 'if "%_?" != "0"'. This will be true if ffind returns no matching files and false 
otherwise. The rest of the alias is pretty much the same. I search for \%1~ first and %1 if 
that fails. This method could be extended by adding another 'if "%_?" != "0"' searching for
'\%1\' and then finally search for '%1' only. 

Viva la 4DOS, Mark Andrews
