Solved

delete directory

Posted on 2002-07-02
3
124 Views
Last Modified: 2010-05-02
hello,

can anyone tell me, how can i delete a non empty dir with vb code?

thanks
0
Comment
Question by:kkarnez
  • 2
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 7124647
This one can work:

Dim fso As Scripting.FileSystemObject
set fso = new Scripting.FileSystemObject
fso.DeleteFolder "D:\Articles\Test"
Set fso = Nothing

You need to check the "Microsoft Scripting Runtim" in the project references...

CHeers
0
 
LVL 5

Expert Comment

by:rpai
ID: 7124695
Dim fso as Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(sFolderPath)

0
 
LVL 5

Expert Comment

by:rpai
ID: 7124700
Oops..Sorry Angelll. did not mean to post the same code!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now