delete directory

hello,

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

thanks
kkarnezAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
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
 
rpaiCommented:
Dim fso as Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(sFolderPath)

0
 
rpaiCommented:
Oops..Sorry Angelll. did not mean to post the same code!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.