Skip to main content

Check If A File Exists


Question / Problem:  

How do I check if a file exists using KTM Scripting?

Answer / Solution: 

WinWrap does not have a fileExists function. The following code provides that function without resorting to external objects:

Public Function fileExists(filename As String) As Boolean
   On Error Resume Next
   fileExists = FileLen(filename) > -1
End Function

Applies to:  

Product Version Category
KTM 6.3 Scripting
KTM 6.2 Scripting


  • Was this article helpful?