Delete Folder

T

Todd Huttenstine

How do you delete the following folder programmatically?

C:\test


Thank you
Todd Huttenstine
 
T

Todd Huttenstine

Hey guys, I got it. Below is what I did to delete a
folder. In this case I changed the folder I wanted to
delete to SMS Raw Data.

Dim FS As Object

Set FS = CreateObject("Scripting.FileSystemObject")
FS.deletefolder ("C:\Documents and Settings\" & NN
& "\Desktop\SMS Raw Data")


Todd
 
S

Soo Cheon Jheong

Todd,

Try
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub Delete_Folder()

Dim FS As Object
Dim str_F As String

str_F = "C:\Test"
Set FS = CreateObject("Scripting.FileSystemObject")

If FS.FolderExists(str_F) Then
FS.DeleteFolder str_F
MsgBox "Folder deleted"
End If

End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -


--
Regards,
Soo Cheon Jheong
_ _
^¢¯^
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top