I have a written an script to automate my daily data imports and running
scans and explores. Towards the end I am using the following code to delete
some intermediary files. The problem with my code is that if the file to be
deleted does not exist the jscript crashes. Is there a way to check to see
if the file exists before attempting to get the file "fso.GetFile"? if so,
please advise. TIA

 

var fso, f;

fso = new ActiveXObject("Scripting.FileSystemObject");

f = fso.GetFile("c:\\Amibroker\\CSV Files\\O5.XLS");

f.Delete();

Reply via email to