Method: Delete for File
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: Delete for File
Method: Delete for File
Deletes a file.
Object.Delete([Force])
| Object | File Object with this method |
| [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 a file:
Sub DeleteMyFile(sFile,bForce) Dim fso, oMyFile Set fso = CreateObject("Scripting.FileSystemObject") set oMyFile = fso.GetFile(sFile) Call oMyFile.Delete(bForce) End Sub