FIL. - File and Directory Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Filesystem-Commands > FIL. - File-Commands > FIL.DIR-Commands >

FIL. - File and Directory Commands

FIL.MFDIRS

Previous Top Next


SPR Script Language

 

FIL.MFDIRS

Searches for Directories across multiple folders using wildcards in the path.

 

Intention

 

The FIL.MFDIRS command (Multi-Folder DIRS) is a specialized search tool for finding directories only.

Its key feature is the ability to use wildcards (*, ?) in the parent parts of a path. It works by recursively finding all directory paths that match the wildcard pattern and then returning those paths in a global array.

 

Illustration

🗺️ City Planning: This command is like a city planner looking for all districts that match a pattern (e.g., "*-central").

It returns a list of the districts themselves, not the individual buildings (files) inside them.

 

Syntax

 

FIL.MFDIRS|Array-No.|PathWithWildcards[|Options]

 

Parameter Explanation

 

P1 - Array-No. - (Numeric, Required)

The number (0-32) of the global array where the results will be stored.

 

P2 - PathWithWildcards - (String, Required)

The full path specification, where wildcards (*, ?) can be used in any directory part. The path must end with a backslash. Example: C:\Users\*\AppData\Local\*\.

 

P3 - Options - (String, Optional)

A comma-separated string of keywords: INFO, SORTUP, SORTDOWN.

 

Examples

 

'***********************************

' FIL.MFDIRS - Sample 1: Find all user Temp folders

'***********************************

' Find the "Temp" folder inside any user's Local AppData folder

FIL.MFDIRS|1|C:\Users\*\AppData\Local\Temp\

FIL.ArrayToVar|1|$$res

MBX.Found Temp folders:$$crlf$$$$res

ENR.

'

'***********************************

' FIL.MFDIRS - Sample 2: Find all "Help" folders in Program Files

'***********************************

FIL.MFDIRS|2|C:\Program Files*\*\Help\|SORTUP

ARR.Get Array|2|0|$$sum

MBX.Found $$sum matching "Help" folders.

ENR.

 

Remarks

 

- This command only returns directories. To find files within wildcard paths, use FIL.MFDIR.

- The path pattern must end with a backslash `\` to signify you are searching for directories.

 

See also:

 

FIL.MFDIR

FIL.MFDIRA

FIL.DIRS