Hi all! I need a workflow to periodically check if there are new excel files in a directory, and if there are, they need to be moved to another directory. The workflow I have built (see attachment) works fine if there are any excel files available and moves them to the desired folder, however, it throws the following error if the directory is empty:
Error: Run Command (17): The external program "%temp%\MoveFiles.bat" returned an error code: 1
Is there a way to stop/finish this workflow without throwing an error if there are no excel files to be moved? Any help will be greatly appreciated.
Solved! Go to Solution.
Hi,
Unfortunately I dont think there is a way to suppress errors (though please someone correct me) but based on this workflow, do you think this could be better accomplished using windows scheduler to run the bat file? I would think its a more seamless execution.
@oce,
Please make sure that the target file exist and you have at least one excel file in the source folder.
I updated cmd tool and works fine.
Attached the workflow,
Hope this helps!
Regards,
Hi @atcodedog05,
Thanks a lot, this is definitely working also when no files are present in the directory. The only thing is that the files are not moved from the initial directory but copied, so they still exist there too. Do you know if & how I can modify the blob tools to behave like "cut & paste" instead of "copy & paste"?
Hi @oce
Sorry nope 😶 it works only has copy and paste.
What you can do is use a filter and filter the files that was created today. That way only newly created files are moved.
Workflow:
Hope this helps : )
@atcodedog05 This solves my problem, thanks a lot! 🙂
Happy to help : ) @oce
Cheers and have a nice day!
Could someone please share the .bat file that was used for command run tool
@jsilavong Look at @messi007 's solution. The bat file is created on the fly by the workflow. The formula tool dynamically generates.