Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.
SOLVED

ERROR when running .bat file in "After Run" event

Highlighted
Alteryx Partner

Hi All,

 

I have created a batch file to rename files after processing in a workflow.

I followed the instructions in this article:

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Batch-Files-in-Alteryx-Part-1-Creat... 

 

When I try to run this batch file in the events area of the workflow as "After Run", I get the following error:

Error: Designer x64: The Designer x64 reported: Error running Event #1: The external program ".\Test Workflow\Test Rename\2020-01\rename_files.bat" returned an error code: 1: The system could not find the environment option that was entered. (203)

 

With community search I found some discussions but unfortunately no feasible solution.

 

Can anyone help?

 

Thanks,

Michael

 

Highlighted
12 - Quasar

See this suggestion: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Bat-script-error/td-p/486262

 

Add a Pause in your BAT file.

 

Can you post the text in your BAT file?

Highlighted
Alteryx Certified Partner

Hi @MichaD, as @ChrisTX suggested, see if you are able to run the batch file from command prompt to begin with.

 

As an alternative approach, you could also use the Run Command tool to execute batch files. I had put together this solution (attached) for another community post a couple of days ago, but should be a good reference in this case too. I too did get an Error code 1 a couple of times building this solution, and found the issue was that my source folder location was empty. 

 

I am not sure my input here is adding much value, but thought I'll present an alternate approach and what worked for me.

Highlighted
Alteryx Partner

Good hint, I will try to run it from the command prompt first.

I'll also give the Run Command approach a try.

Thanks @ChrisTX @AbhilashR 

Highlighted
Alteryx Partner

 

By adding PAUSE and running the bat file from the command prompt I found out that the path wasn't found. This was due to "ü" in the path (my German user name), see screenshot:

cmd.JPG

 

I know I have to change the codepage to 1252 by adding "CHCP 1252" to the command to solve this and if I do this manually in the bat file it works:

 

bat.JPG

 

But I'm not sure how I have to change the workflow that creates the bat file in order to add this "CHCP 1252" line to the bat file.

Any idea on that?

 

Attached you can find my workflow.

Highlighted
12 - Quasar

Take a look at the workflow "run_command_code.yxmd" in this post:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/how-to-update-Run-configuration-using-...

 

Labels