Method: DeleteFile for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: DeleteFile for FileSystemObject
Method: DeleteFile for FileSystemObject
Deletes one or more files.
Object.DeleteFile(FileSpec, [Force])
| Object | FileSystemObject Object with this method |
| FileSpec | String Specifies the path of the files that you want to delete. The path may contain wildcards in the last path component. |
| [Force] | Boolean Specifies whether DIAdem deletes write-protected files. If the value is True, DIAdem deletes write-protected files. If the value is False, DIAdem does not delete write-protected files. The default value is False. |
The following example deletes one or more files:
Sub DeleteMyFiles(sFile,bForce) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Call fso.DeleteFile(sFile,bForce) End Sub