Loop Through Files in a Folder - VisualCron - Forum

Community forum

jtnelso
2009-08-25T05:14:06Z
I have a need to loop through a folder containing multiple files.

Ideally, I want to:
1) Take the first (or any) file, rename & move it to trigger an import job,
2) Move that file out, then
3) Repeat the process using the next available file in that folder. (step 1)

I'm stumped on how to set this job up. Any thoughts?

I have attached a sample screenshot of the folder/files for visual reference.
I'm using VC 4.9.26.
ErikC
2009-08-25T07:52:38Z
Hi,

You can create a batch file for this:

FOR /f %%A IN ('DIR /B D:\SOURCEDIR\*.*') DO (
  MOVE D:\SOURCEDIR\%%A D:\DESTINATIONDIR
)


Run this batchfile with the run command task.

Put the file trigger on the destinationdir.

So you need tweo jobs for this:
1 job for running this command task.
The other for handle the triggered files.

Regards,
Erik
Uses Visualcron since 2006.
Scroll to Top