Read from File - error 'xcopy' is not recognized as an internal or external command

Document ID : KB000099888
Last Modified Date : 08/06/2018
Show Technical Document Details
Issue:
When attempting to use the read file operator the operator fails with the message:

'xcopy' is not recognized as an internal or external command, operable program or batch file.
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\
 
Additional Information: