xxcopy single file copy in Java fails with double spaces in filename
Posted on 2009-04-16
I'm using xxcopy to do single file copies in a Java program. All is well, unless the filename contains two consecutive spaces.
cmd /c xxcopy "c:\source\folderx\file name.doc" "c:\dest\foldery\" /VL /C /H /K /YY /Q3
The code looks something like this, where sExec is the string above:
Process p = Runtime.getRuntime().exec(sExec);
iRtn = p.exitValue();
I'm outputting the exact value of "sExec", and then copying it into Start/Run. It runs successfully from Start/Run. Does anyone understand why this same command fails when run from a Java program?