Alteryx Designer Desktop Discussions

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

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

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: 


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?





15 - Aurora

See this suggestion:


Add a Pause in your BAT file.


Can you post the text in your BAT file?

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.

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 

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:



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:




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.

15 - Aurora

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