Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

FileSystemObject : DeleteFolder Method

Description: 

This func­tion Deletes a Folder.

Format : 

objectOf­FileSys­te­mOb­ject. Delete­Folder ( fold­er­spec[, force] )

Arguments: 
    • objectOf­FileSys­te­mOb­jec­tAs the names says, it’s a FileSystemObject.
    • fold­er­spec
      • Manda­tory
      • Type:     String
      • Folder name to be deleted.
    • Force
      • Optional
      • Type: Boolean ( True: force deleted even if the folder is in read-only attribute, False (default): not deleted if in read-only attribute.
Function FnDeleteFolder(strCompleteFolderPath)
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set objFolder = fso. DeleteFolder(strCompleteFolderPath)
End Function

Call FnDelete­Folder (“c:\New Folder”)

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: