I am running a build from Team Foundation Server(TFS), and the build is failing with the error
"xcopy "C:\eComObjects_MP10\Microsoft\DynamicsCrm"
"D:\Builds\19\Unicorn\MaintPackage10- Daily\Sources\MaintPackage10\WebInterface\Store\Inetpub\wwwroot\Bin\DynamicsCrm"
/E /Y /I " exited with code 4".
When I simply go to the command prompt and run the above command, it fails, but when this command is run after removing /E/Y/I and the double quotes at the end, it works fine from the command prompt. What might be wrong here ?
Since it's also failed with command prompt, so it's not related to TFS build.
Xcopy exit code 4 means "Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line."
There are various reasons for this. In your case it may due to the length of Source and Destination (Path length). resulting path names exceeded the maximum allowed length. It may due to the /e
option /e : Copies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options.
Xcopy command reference.
For more ways, you could refer below similar question: