Hidden Files in LotusScript

I am trying to delete a directory and all it’s files and sometimes, but not always, it contains a hidden file “thumbs.db”. I cannot get the DIR$ command to see the hidden file. If I don’t remove the file, I can’t remove the directory (rmdir) - I get a path/file access error. Code below should get all files, including hidden files (does not get hidden files). I have tried 16 and 2 in place of 32 also. None give hidden files.

filename = Dir$(strDirExists,32)

Do While filename <> “”

Kill ftpOutDrive + strDirectoryName + "" + filename

filename = Dir$()

Loop

I can hardcode the file to delete but I can’t check to see if it exists first. if I try to kill it and it’s not there, I also get an error.

How can I remove/test for hidden files using LotusScript?

Thank you.

Subject: Idea

Possibly shell out before you try and delete files and run the windows attrib command against all the files in the directory with the -R -H flags.

The other option is to trap the error and test the error code and continue on if it is becuase of the file that did not exist

Subject: You’re using the wrong number…

According to Designer Help, the second argument to the Dir function must be either one of the numbers in the table below, or the sum of the numbers matching the file types you want.

32 definitely won’t work. It’s not a sum of any of those numbers.

16 will return only non-hidden directories and normal files.

If you want hidden files along with normal files, but excluding directories, specify 2.

If you want hidden and normal files, and including directories, specify 18 (the sum of 16 and 2).

Mask

File attribute

Constant

0

Normal file

ATTR_NORMAL

2

Hidden file

ATTR_HIDDEN

4

System file

ATTR_SYSTEM

8

Volume label

ATTR_VOLUME. If any other attribute is specified, ATTR_VOLUME is ignored.

16

Directory

ATTR_DIRECTORY