Sponsored Links: |
Delete a local or network folder.
.
.
.
.
.
.
.
.
.
.
.
' =============================================================
' function: FolderDelete
' desc : Deletes a folder and all of it's contents
' params : strFolder - the folder to delete
' returns : void
' =============================================================
' desc : Deletes a folder and all of it's contents
' params : strFolder - the folder to delete
' returns : void
' =============================================================
Function FolderDelete(strFolder)
Dim objFS
' create a file system object
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFS = CreateObject("Scripting.FileSystemObject")
' check that the source folder exists
If Not objFS.FolderExists(strFolder) Then
If Not objFS.FolderExists(strFolder) Then
' fail if the source does not exist
reporter.ReportEvent micFail, "Delete Folder", "Unable to Delete Folder '"& strFolder &"', It Does Not Exist"
reporter.ReportEvent micFail, "Delete Folder", "Unable to Delete Folder '"& strFolder &"', It Does Not Exist"
Else
' delete the folder
objFS.DeleteFolder strFolder
End If
objFS.DeleteFolder strFolder
End If
' destroy the object
Set objFS = Nothing
End Function 'FolderDelete
Set objFS = Nothing
End Function 'FolderDelete
Source: https://qtphelper.com
0 comments:
Post a Comment