Home Search

DriveWorks Pro 21
SppGetFileCount

Send Feedback

SppGetFileCount

Returns the number of files in the selected folder.

Syntax

SppGetFileCount([Root Folder],[Search Pattern],[Include Sub Directories])

Where:

Root Folder is the folder from which the files will be counted.

Search Pattern is the search string to match against the names of the files in the path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.

For more information on .NET framework search patterns, please see Microsoft Article: GetFiles (searchPattern)

Include Sub Directories is TRUE to include sub directories, FALSE to only use the top level folder.

Examples

RuleResultMeaning
SppGetFileCount("D:\DriveWorks\Entrance Canopy","*",TRUE)31Will count all the files within the given folder and its sub directories that match the search pattern *.
SppGetFileCount("D:\DriveWorks\Entrance Canopy","*s.txt",TRUE)3Will count all the files within the given folder and its sub directories that match the search pattern (file names end with s.txt).