Get File List, including files in subfolders

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Get File List, including files in subfolders

Post by winstein » Sun Jun 11, 2017 7:55 pm

The GetFileList function is useful for getting the list of files within a particular folder, but what I want to do currently is to also look for certain files in sub-folders, so for example, I want to look for all PNG files in a designated folder and any folders within the folder. What is the best way to do this?

Thanks for reading.
PPQ

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Get File List, including files in subfolders

Post by JRL » Mon Jun 12, 2017 6:53 pm

I know there are other ways but I like to use DOS dir.

Code: Select all

Let>RP_Wait=1
Let>RP_Windowmode=0
RunProgram>cmd /c dir c:\designated Folder\*.png /s /b > %temp_dir%\MyFiles.txt
ReadFile>%temp_dir%\MyFiles.txt,vData
DeleteFile>%temp_dir%\MyFiles.txt

MDL>vData

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts