@RANDFILE
— Picks a file at
random and returns its filename.
Syntax:
%@RANDFILE[
/A:
attribs /S /[
range]
wildspec]
wildspec | required; directory aliases are supported |
/A: attribs | filter by attributes; use /A:D to find subdirectories instead of files |
/S | search for matching files in subdirectories |
/[ range] | many range options are supported |
wildspec | required; directory aliases are supported |
@RANDFILE
makes a list of files matching the given
wildspec, picks one at random, and returns a
complete pathname. If no files match the wildspec,
this function returns an empty string.
• Note: Enumerating all matching files can take a long time, especially
if you use /S
.