Re: Mass delete files and directories

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



In article <O$TyIasrIHA.800@xxxxxxxxxxxxxxxxxxxx>, yoohoo@xxxxxxxxxxxxxx
says...
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.

If you know this is running on XP or later, the DEL command has a /S
switch to delete subdirs as well.


--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
.



Relevant Pages

  • Mass delete files and directories
    ... This may sound a bit strange, but I have never had to do this before. ... 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? ...
    (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: How do I unlock a file ? / SOLVED !
    ... rmdir historically existed before the recursive flag to rm. ... ordinary users to remove their own directories, but they still had to be ... If you could delete non-empty directories without deleting the ... referenced files, you can end up with files without a reference in any ...
    (Ubuntu)
  • Re: How do I unlock a file ? / SOLVED !
    ... rmdir historically existed before the recursive flag to rm. ... Only root could add or remove files which were directories. ... If you could delete non-empty directories without deleting the ... referenced files, you can end up with files without a reference in any ...
    (Ubuntu)
  • Re: Batch file executed at startup
    ... [[Deleting the current directory ... You cannot use rmdir to delete the current directory. ... Kill explorer.exe and use the command prompt to delete the folder. ...
    (microsoft.public.windowsxp.customize)