The XCOPY command

[Autolink] Menu

In OS/2 WARP 4 you may get the error SYS1186 while trying to copy files with odd characters in their names (e.g. "²1■%E■.AX■") using XCOPY.
To resolve this problem, you must change the codepage to 437. To do this either issue the command CHCP 437 for a temporary change, or change the codepage line in the file CONFIG.SYS to CODEPAGE=437,850 and reboot the system to make the change permanent.

Please note that I cannot reproduce this error on my system with WARP 4 and Fixpack #1.

---------- * ----------

According to the OS/2 online help, XCOPY should return a return code of 2 if it cannot access one or more source or target files. In reality (OS/2 WARP 3 with Fixpack #17) XCOPY returns 0 in this case.

(Note: I've tried this again with WARP 4 Fixpack #5 - and at least in this environment XCOPY does return a return code of 2 in case of an error.)

To get around this bug, you can use a REXX program (see below) to call XCOPY, redirect its output to the REXX queue and check the contents of the REXX queue afterwards to get the results of the XCOPY command (see also The COPY command).

Warning: XCOPY is a version dependent program! Always use the XCOPY.EXE from the current active OS/2 version!!!