Skip to main content

List Folders

Command description

Get the list of subfolders under the specified path and save it as a list variable.

Command Input Parameters

input parametersInput parameter typeDescription
Folder PathstrAbsolute path of the folder to search
Subfolder Name PatternstrDefault *, customizable matching rules, such as 1*
Search Subfolders RecursivelyboolWhether to find the target folder and all its subfolders

Command Output Parameters

Output parametersOutput parameter typeDescription
Folder Listlist[str]Obtained folder path list

Edge Cases

  • The command reports an error if Folder Path does not exist or is not a folder.
  • The result contains folders only. When Search Subfolders Recursively is False, only immediate subfolders are searched; when True, all descendant folders are searched.
  • An empty Subfolder Name Pattern is treated as *. If nothing matches, the command returns an empty list.

Generation Notes

  • Returns a list of subfolders, excluding ordinary files.