I am trying to run a batch command in my workflow. I need to delete/rename some files after Alteryx reads/creates them. However I keep getting an error when I run my batch file.
Alteryx says that I need an input/output in order to use the Run Command tool. My data is going into the Run Command tool via the input connector. I do not require an output - only that the batch file runs.
I did read elsewhere that I need to specify an input/output (despite Alteryx labeling it as "optional"). I tried some of the suggestions, but then Alteryx hangs up when the batch command is ran, and never completes. I created a temp.csv file just to have something in the Output field, but that didn't work.
The batch file runs with no problems if I run it outside of Alteryx (although I do need to right-click and run it as an administrator). Does anyone know what I may be doing wrong here?
Solved! Go to Solution.
Hi @taran42 ,
Not sure why you get an error.
You can get around the Input/Output requirement by using the temp folder, e.g. %temp%\CopyTemplate.bat.
Examples how it works for me:
Using the cmd from inside the workflow - both path are fake:
Running an external bat script - the write source path is fake, the other one runs the bat script:
Please mark this as the solution if it answers your question, it will help others to find solutions quicker.
Kind Regards,
Kilian
Solutions Engineer - Alteryx
@KilianL Thanks for the reply.
While the fake path does get me around the input/output error, the external script still will not execute.
I'm wondering if it has to do with administrator rights? If I run the batch script on it's own, it will not execute. If I run it as administrator, it will work. I tried running Alteryx as Administrator, then running the workflow, but that did get the script to run either.
Could it be that the batch script needs to run as administrator within the workflow? If so, how do I do that?
Ultimately I was able to get my workflow to run properly. I tried @KilianL 's suggestions, but they didn't work. I ended up rebuilding everything from scratch (the batch file and workflow). It now works, as intended, as Kilian's solution suggests (which is why I accepted it as the correct answer). The only idea I have as to why mine didn't work was that there was something, somewhere, either in the workflow or the script, that was preventing it from executing fully.