[fpc-pascal]Deleting the current directory (after changing it)

Rich Pasco pasco at acm.org
Tue Mar 19 00:49:09 CET 2002


Peter Vreman wrote:

> A batchfile ?

We all know there are severe limitations in BAT as a programming
language.  I want to do much more than just switch to the parent
and then delete the old current directory (I omitted the rest from
my example because it was irrelevant to my question).  However,
just for the sake of argument (and getting a little off-topic here),
can you exhibit a BAT file that will do it (switch to the parent
and then delete the old current directory)?

You obviously can't do
  RD .
  CD ..
because you can't remove the current directory.

Suppose you try to do
  CD ..
  RD  --now what?--

How do you preserve the name of the initial working directory to use it
as the argument for the subsequent RD?

     - Rich




More information about the fpc-pascal mailing list