...
FYI, the only changes I have planned is the enhancement for CDD to support path ignoring any filename portion (as requested). Any patches
...

This is now implemented in cvs.
I have added support for CDD path/filename, where the filename portion is stripped (ignored) if and only if this refers to a valid file. This means CDD to a nonexistant file will be treated as CDD to a nonexistant directory, ie an error. In all other aspects CDD should behave as before.

For now this only effects CDD, as the code explictly checks if CDD variant was used, if desired, this feature can be easily extended to work with CD as well.

Example usages:
  C:\SOMEPATH\SOMEDIR> ECHO %COMSPEC%
  C:\DOS\COMMAND.COM
  C:\SOMEPATH\SOMEDIR> CDD %COMSPEC%
  C:\DOS>

or here is a little trick to allow executing a batch file from
any directory and obtaining the path to that batch file (FreeCom only).
It saves current directory (so we can restore current dir), then determines if batch file called with .BAT or not (as CDD requires file to exist, only one of the two cdd calls will work), at this point the current directory (and drive) are now the same as the batch file, so we store it in the BATCHDIR env variable, and finally restore the caller's current directory. Then you can do whatever you wanted to do.

@echo off
pushd .
if exist %0 cdd %0
if exist %0.bat cdd %0.bat
set BATCHDIR=%_CWD%
popd .
echo %BATCHDIR%





-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to