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:
Solved! Go to Solution.
If you run the bat file manually does it work?
Strangely enough the folder is created even on Alteryx, but there is still an error.
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
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:
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:
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
@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.
@RolandSchubert No, unfortunately, I tried this and got the same error
@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! 🙂
@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?
Due to Windows behaviour I do not see this feasible, since also Windows is displaying an error when tying to overwrite:
Alteryx is simply picking that error and showing it as an Windows error ("Code 1").