Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Running Batch Command Throws Error/Won't Complete

taran42
8 - Asteroid

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.

 

taran42_0-1628539706846.png

 

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.

 

taran42_1-1628539716636.png

 

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.

 

taran42_3-1628540103859.png

 

taran42_4-1628540188686.png

 

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?

3 REPLIES 3
KilianL
Alteryx Alumni (Retired)

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:

 

Screenshot_2.jpg

 

 

Running an external bat script - the write source path is fake, the other one runs the bat script:

 

Screenshot_1.jpg

 

 

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

 

taran42
8 - Asteroid

@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?

taran42
8 - Asteroid

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.

Labels