Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Error: "The external program <PROGRAM_NAME> returned an error code: 1" when using Robocopy command

clarab
Alteryx
Alteryx
Created

Error: “The external program "<PROGRAM_NAME>" returned an error code: 1”

 

Environment Details

 

The Run Command tool calling a batch file returns the following error if Windows robocopy command is used:
 

The external program "<PROGRAM_NAME>" returned an error code: 1  
 
  • Alteryx Designer
    • Version: All
  • Windows robocopy command


image.pngimage.png

Cause

 

The robocopy command generates a detailed report after the command is executed and this causes an issue with the Run Command tool.

Here is an example of the report:

image.pngimage.png



Resolution


To prevent the Run Command tool from throwing an error, please include "exit /b" command in the batch file after the robocopy command to exit the script. 

Here is an example of a batch file:
mkdir c:\temp\createforfun
ROBOCOPY "C:\temp\FromMe" "c:\temp\createforfun" /MIR /log:robolog.txt
exit /b


Note: The /log option is added in the above example to check the status of the robocopy command. This is optional.


 

Additional Resources

Comments
DPHI
5 - Atom

This is such a great solution.... I spent so long trying to figure out how to get this rectified and such a simple fix!!!!
Thanks very much 😁