VB5: An Oldie.

Posted on 1998-07-27
Last Modified: 2010-05-03
I have asked this question before but didn't receive a satisfactory response.  This function keeps coming up for me though and it would really be nice to have a solution for it.

You only get the points for a complete and correct answer.

I would like a function that will delete a directory and all of its files and subdirectories.  

Sounds easy right?  It has to work.  No error messages.  No unexpected behavior.  All files must be deleted.

Please submit source code in VB5 so that I may run and test it.

Question by:lankford
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1466863
Does this function need to work in Win NT?  I have a very basic function usuing a shelled
deltree command, that works in Win95.  It works because Win95 includes the DOS deltree command.  I have a VB5 sample app that uses the code, which I can email to you, just email me with your email address at: .  If you need it to work in NT, let me know, I have code mostly written for a non-deltree way of doing it.

:) D Perry

Expert Comment

ID: 1466864
You should not lock the question if you are not provide an answer.


Author Comment

ID: 1466865

I need this to work on all 32-bit Windows platforms.


Accepted Solution

SeanGiles earned 300 total points
ID: 1466866
go to and search for "delete directory".  Only change I would make to this code is to check any file attributes that would cause the  vb "kill" command to fail and change them with SetAttr first.


Author Comment

ID: 1466867
Aaahhh.  Exxxcellent!

Mr. Burns

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question