@EXPAND[[range...] filename[,[{+|-}]rhsadecijopt]] : Returns (in a single line), the names of all files and directories that are within the specified range[s], AND match filename, AND have the specified attributes. Filename may contain wildcards and include lists. Returns an empty string if no files match. Each returned filename which contains white space or other special characters will be delimited by double quotes.

 

Filename must be in double quotes if it contains white space or special characters.

 

The range and attribute parameters, if included, define properties of the files that will be included in the result as specified in File Selection. Multiple range parameters may be included, but not more than one each of description range, size range, date range, and time range. Range parameters must precede filename.

 

Examples:

 

echo %@expand[/[s2k,3k] *.txt]

 

displays all files with extension txt in the current directory with size at least 2000 bytes and at most 3000 bytes

 

echo %@expand[*,d]

 

displays all subdirectories

 

echo %@expand[/[d-365] %windir\w*.exe;w*.dll]

 

displays all files at most 365 days old in the Windows directory, with extension EXE or DLL, and name beginning with W.