I’m trying to use the Execute Command node to create a list of files in a directory but it can’t read the path if I use an expression in the pathway
What is the error message (if any)?
Command failed: dir “C:\Users\Administrator\Desktop\Manga\Batch{{ $json.dirs.replace(/\r?\n|\r/g, “”) }}” /b /o:gn The system cannot find the path specified. [item 0]
This workflow suggestion that I sent should be tested separately from your workflow, so that you can check if the suggestion makes sense and so that you can test it according to your needs.
Open a separate workflow and test the suggestions below.
You are setting the dirs field with a string that contains the expression {{$json.dirs.replace(…)}}, but as raw text, and not as an expression to be executed.
Go to the SET NODE in the Manual Mapping tab and locate the fields to set configuration for the dirs value, then replace the current content in the Value field with
See if it will display the generated paths as…
C:\Users\Administrator\Desktop\Manga\Batch\subdir1
C:\Users\Administrator\Desktop\Manga\Batch\subdir2
C:\Users\Administrator\Desktop\Manga\Batch\subdir3