Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

The external program "[location]\RunCommand.bat" returned an error code: 1.

Paulomi
8 - Asteroid

I am using a run command tool to create new folders within my workflow on Alteryx. The bat file is simple - 

 

mkdir C:\Users\username\Desktop\foldername

 

But I am getting an error that says - The external program "[location]\RunCommand.bat" returned an error code: 1. 

 

Could you tell me where I could be going wrong? 

 

And my run command configuration is as: 

 

Paulomi_0-1625054954979.png

 

10 REPLIES 10
Luke_C
17 - Castor
17 - Castor

If you run the bat file manually does it work?

Paulomi
8 - Asteroid

Strangely enough the folder is created even on Alteryx, but there is still an error. 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @Paulomi ,

 

I think, the error says, there is an error in the command, maybe there are any spaces in the directory string,  You could try: 

mkdir "C:\Users\username\Desktop\foldername" 

 

Let me know if it works for you.

 

Best,

 

Roland

 

 

 

 

MatthiasSeil
Alteryx Alumni (Retired)

Hey,
I suppose you use Alteryx to create the .bat file, right?

Means you have the cmd in Alteryx created, e.g. via Formula tool:

MatthiasSeil_0-1625058952849.png

Note to set the path in quotes, only then Windows can understand spaces in a string. Also note that the string max. size must not exceed 64000.

 

You then create the .bat file (no matter whether to temp or a drive):
When choosing for an output .csv is too cumbersome to configure for me, thus I usually go via Flat ASCII:

MatthiasSeil_1-1625059182223.png

 

The rest of your configuration looks good, so that should do the trick.

Let me know if that works and if yes, please select it as solved.

 

Cheers

 

Matthias

Paulomi
8 - Asteroid

@MatthiasSeil I had actually created the bat manually, saved it in a location and used the run command tool to access it. However, now that you suggested a different approach, I also tried to create the file through Alteryx, and I got the same error. 

Paulomi
8 - Asteroid

@RolandSchubert No, unfortunately, I tried this and got the same error 

Paulomi
8 - Asteroid

@MatthiasSeil Its working now! There was a minor error that I almost missed. In your method, I had to use a select tool to cut out some other columns because that was getting concatenated with the bat command. But, thank you so much! I'll accept your answer as the solution! 🙂 

Paulomi
8 - Asteroid

@MatthiasSeil On a similar note, I had another issue. Is it possible for alteryx to run the run command for new folder creation without errors when a folder already exists by the same name? 

MatthiasSeil
Alteryx Alumni (Retired)

Due to Windows behaviour I do not see this feasible, since also Windows is displaying an error when tying to overwrite:

MatthiasSeil_0-1625136969300.png

 

Alteryx is simply picking that error and showing it as an Windows error ("Code 1").

Labels