'xcopy' is not recognized as an internal or external command using "Read from File" operator in Process Automation
search cancel

'xcopy' is not recognized as an internal or external command using "Read from File" operator in Process Automation

book

Article ID: 99888

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Process Automation Base Process Automation Manager

Issue/Introduction

When attempting to use the Read from File operator the operator fails with the message:

'xcopy' is not recognized as an internal or external command, operable program or batch file.

Environment

Process Automation - 4.3.X

Cause

To read a file, Process Automation first makes a copy into a temp directory then reads that copy. 

The error message is indicating a pathing issue to the xcopy application in either \windows\system32, or the 64bit version in \windows\sysWOW64\

Resolution

Attempt xcopy using a similar command as Process Automation is issuing:

C:\>xcopy /Q /H /X /Y "D:\PAM\OpenTasks\6944.txt" "D:\pam\temp\.c2otmp\6944_tempFile.txt"

if this fails with the same error, check your PATH and ensure that system32, or syswow64 is part of the path.  If not add it, you can use a command similar to the following to update the path:

set Path=%path%;C:\Windows\system32

this command will add C:\Windows\system32 folder to the %path%

Retry the xcopy in a command window, then retry within Process Automation.
 
If the command line works, but the process is still failing with this message, then there is an issue with Process Automation picking up the PATH.   To get around this,
set in the read File Operator in the "Working Directory" field the path to the xcopy app, for example:

"C:\\windows\\system32"

Your process should now be able to locate xcopy and read from the file.3

And finally, if this does not work, ensure that the Working Directory within the Read Operator is set to the path of xcopy: "C:\\windows\\system32"