Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Hudson not recognize xcopy as a command?

I have a windows batch command in my hudson build step that is basically:

 xcopy /s *.* \\serverlocation\buildname\

The copy is failing with:

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

However, xcopy is usable on the command line (as is copy). What do I need to do to make hudson use xcopy?

Edit: My path is

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Perforce;C:\Program Files\CVSNT;C:\Program Files\CVSNT\

which is probably why it works from the command line.

like image 534
mmr Avatar asked Mar 01 '23 13:03

mmr


2 Answers

xcopy is in your system32 directory; make sure that's in your PATH.

like image 175
Chris Jester-Young Avatar answered Mar 13 '23 00:03

Chris Jester-Young


Something you may want to watch out for when using Xcopy with Hudson (or other build systems really) is the total length of the path of the file being copied.

In my case, I'm running into issues using xcopy to copy files that are buried many levels down in a directory structure such that when combined with Hudson's working/build path level, it (I'm assuming) exceeds the maximum allowable path length for xcopy to work with. My current work-around is to simply zip build output before copying it, but I'm looking for something a little cleaner.

like image 44
Peter Bernier Avatar answered Mar 13 '23 01:03

Peter Bernier