Mass delete files and directories



This may sound a bit strange, but I have never had to do this before. I am creating a program which, among other things, allows deletion of a directory. I know that RmDir will delete an empty directory, but, outside of finding the deepest sub-directory and deleting all the files in it, then deleting the actual directory and working my back up, is there another way to do this? I have some old routines that did this, but I find that they are way too slow.

A user may have as much as several gigs of files (this is a virtual simulator) in hundreds of sub-directories so this could take aeon's to complete the task. I've looked several places and am familiar woth API calls, but have found nothing that helps me much.

Using VB6, with SP6.

GP
.



Relevant Pages

  • Re: Mass delete files and directories
    ... I know that RmDir will delete an empty directory, but, ... outside of finding the deepest sub-directory and deleting all the files ...
    (microsoft.public.vb.general.discussion)
  • Re: Mass delete files and directories
    ... I know that RmDir will delete an empty directory, but, outside ... of finding the deepest sub-directory and deleting all the files in it, ...
    (microsoft.public.vb.general.discussion)
  • Re: Neither of my 2 CD Roms/CDRW do not work!!!!
    ... sound like it applies but take the steps outlined there to delete the Upper ... deleting some other things which can cause problems as well): ...
    (microsoft.public.win2000.registry)
  • deleting a file
    ... Try rebooting your computer (into safe mode if necessary) ... and deleting before doing anything else. ... Strange things ... can latch onto and "use" a file in hard to detect ways. ...
    (microsoft.public.windowsxp.general)
  • Strange Problem
    ... Soon after I open a blank document a blank document in word 2002, strange ... phrases and at times some menu options are getting typed ... I did a complete virus scan with McAfee Anti-virus and also tried deleting ...
    (microsoft.public.word.newusers)