Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

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

MichaD
8 - Asteroid

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

 

5 REPLIES 5
ChrisTX
15 - Aurora

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?

AbhilashR
15 - Aurora
15 - Aurora

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.

MichaD
8 - Asteroid

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 

MichaD
8 - Asteroid

 

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.

ChrisTX
15 - Aurora

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