The function File/Directory Info if passed a directory as it's path input, returns the total number of objects in the directory. This is files plus any sub-directories. The function List Directory returns an array of file names and an array of directory names. To get the number of files, just use the Array Size function. Look at the File I/O>Advanced File Functions palette to find File/Directory Info and List Directory functions.