Method: DeleteFolder for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: DeleteFolder for FileSystemObject
Method: DeleteFolder for FileSystemObject
Deletes a folder and its content.
Object.DeleteFolder(FolderSpec, [Force])
| Object | FileSystemObject Object with this method |
| FolderSpec | String Specifies the path of the folder that is to be deleted. The path may contain wildcards in the last path component. |
| [Force] | Boolean Specifies whether DIAdem deletes write-protected files and folders. If the value is True, DIAdem deletes write-protected files and folders. If the value is False, DIAdem does not delete write-protected files and folders. The default value is False. |
The following example deletes a folder:
Sub DeleteMyFolder(sFile) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFolder(sFile) End Sub