[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

delete directory

Posted on 2002-07-02
3
Medium Priority
?
134 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
[X]
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
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

656 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