Forum Discussion
I created a small script that checks if a file exists and then deletes it. if its just for testing maybe you could also just delete the previous file.
That way you will always create the same file and delete it.
Script created in vbs so might not work completely for you
Function Deletefile(path, file, ext)
'This function checks if the (file) exists, if zo it deletes the file'
Set foundFiles = aqFileSystem.FindFiles((path), (file) & (ext))
If Not foundFiles Is Nothing Then
While foundFiles.HasNext
Set aFile = foundFiles.Next
'(maybe you could add another log message here to see if file was found)'
'This function deletes the (file) in the directory (path)'
aqFileSystem.DeleteFile((path) & aFile.name)
Log.Message aFile.name & " is deleted"
Wend
Else
Log.Warning (file) & (ext) & " kan niet worden verwijderd omdat " & (file) & (ext) & " niet bestaat"
End If
End Function
(sorry for using spaces before the code, I dont know how to import code layout)
Related Content
- 8 years ago
Recent Discussions
- 13 hours ago
- 2 days ago