Board index » delphi » Newbie : Deltree in Delphi 3?

Newbie : Deltree in Delphi 3?

Thanks for taking the time to read.

Is there an equiverlent to deltree in delphi ?   I need to delete a whole
folder (and everything in it) in one go ?

Any help would be great.

Dale Robinson

 

Re:Newbie : Deltree in Delphi 3?


Take a look at SHFileOperation and SHFileOptStruct in the Win API help.

Quote
Dale Robinson <dale.robin...@bigfoot.com> wrote in message

news:7uicvm$edp$1@neptunium.btinternet.com...
Quote
> Thanks for taking the time to read.

> Is there an equiverlent to deltree in delphi ?   I need to delete a whole
> folder (and everything in it) in one go ?

> Any help would be great.

> Dale Robinson

Re:Newbie : Deltree in Delphi 3?


The shFileOperation API can do just that.

Dale Robinson <dale.robin...@bigfoot.com> skrev i en
nyhedsmeddelelse:7uicvm$ed...@neptunium.btinternet.com...

Quote
> Thanks for taking the time to read.

> Is there an equiverlent to deltree in delphi ?   I need to delete a whole
> folder (and everything in it) in one go ?

> Any help would be great.

> Dale Robinson

Re:Newbie : Deltree in Delphi 3?


  Not really, but you could ShellExecute 'deltree' with the proper
commands...

--
Jason Wallace
Home:  Dark...@SLSoftware.reno.nv.us
Work:  Jason_Wall...@Intuit.com

Quote
Dale Robinson <dale.robin...@bigfoot.com> wrote in message

news:7uicvm$edp$1@neptunium.btinternet.com...
Quote
> Thanks for taking the time to read.

> Is there an equiverlent to deltree in delphi ?   I need to delete a whole
> folder (and everything in it) in one go ?

> Any help would be great.

> Dale Robinson

Re:Newbie : Deltree in Delphi 3?


Quote
"Jason Wallace" <Dark...@SLSoftware.reno.nv.us> wrote:
>  Not really, but you could ShellExecute 'deltree' with the proper
>commands...

Deltree is not available on NT.  The code should probably look something
like:

        if  bThisIsWindows9X then begin
           Execute( 'deltree', sPath );
        end
        else begin
           Execute( 'rmdir /s', spath );
        end;
--
- Tim Roberts, t...@probo.com
  Providenza & Boekelheide, Inc.

Other Threads