Hi all,
I have a simple move command in saved as a .BAT file which moves all files in a directory to another location after my Alteryx workflow has run successfully. I have configured this in the events to run. Now, when there are files in the source folder, the script executes perfectly and moves all the files to the target location, and workflow executes successfully. Now when I run the workflow again, the move command can't find any files in the folder and obviously fails stating "The file/directory cannot be found". Subsequently, my alteryx workflow does what it is intended to but it still gives an error message at the end. I want it to bypass this error which means the workflow should not give any error even if file is not found inside the folders. I need this because I have another workflow whose run depends on the success of this workflow. Due to the error message, the second workflow does not execute (I am using a conditional runner macro to achieve this). Any help would be appreciated. Thanks!
Maybe you need add some bat code to determine if the source folder contains at least 1 file.
REM <check any file in source folder.>
dir /b "%source%" >nul 2>&1
if %errorlevel%==0 (
REM < move all files to destination folder >
move /y "%source%\*" "%destination%\"
) else (
REM < if null, exist. >
exit
)
exit