Forum Discussion
tristaanogre
10 years agoEsteemed Contributor
You could use the aqFileSystem object. There is a simple "Exists" method on that object that will check to see if a path to a file is valid.  So, just quick and dirty JavaScript:
function testFileExists(filePath, fileName) {
    return aqFileSystem.Exists(filePath + fileName);
}
function Test1(){
    var result;
    result = testFileExists('C:\\temp\\', 'myfile.txt');
    result ? Log.Message('It is here') : Log.Warning('Nope');
}- bbi10 years agoContributor
In addition you can check if folder exists with this function:
function folderExists(Folder) { var result = false; try { result = aqFileSystem.GetFolderInfo(Folder).Exists; } catch(e) { } return result; };The Folder parameter may or may not include the trailing backslah, no matter.