how to check if a file exists

electron

Administrator
Staff member
Code:
sub main()
  dim filesys
  dim filename
  filename = "c:\motion.txt"

  Set filesys = CreateObject("Scripting.FileSystemObject")
  If filesys.FileExists(filename) Then
    hs.speak "motion detected"
    filesys.DeleteFile filename
  End If 

end sub
 
Thanks Electron, works like a champ. Now just a bit more tweaking like occupancy awareness and I'm in business.
 
Back
Top