/ Forums / Advansys Formativ / Formativ Creator / how can I delete all files in a folder / Reply To: how can I delete all files in a folder

#5544
Support 3
Participant

Iterate through all files in the target folder and delete the file. See below the sample code.

 set oFSO = Utilities.FileSystem
 set oIterator = oFSO.FileIterator
 oIterator.FileSpec = "c:temptest*.*"
 oIterator.load()

 for x = 0 to oIterator.Files.Count -1
   oFSO.DeleteFileOnDisk(oIterator.Files.strings(x))
 next

 set oFSO = nothing

Hope this helps.

Regards,
Advansys Support