ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Folder (https://www.excelbanter.com/excel-programming/307665-delete-folder.html)

Todd huttenstine

Delete Folder
 
How do you delete the following folder programmatically?

C:\test


Thank you
Todd Huttenstine

Todd huttenstine

Delete Folder
 
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


-----Original Message-----
How do you delete the following folder programmatically?

C:\test


Thank you
Todd Huttenstine
.


Soo Cheon Jheong[_2_]

Delete Folder
 
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
_ _
^вп^
--






All times are GMT +1. The time now is 04:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com