mmr
mmr

Reputation: 14929

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.

Upvotes: 4

Views: 3427

Answers (2)

Peter Bernier
Peter Bernier

Reputation: 8069

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.

Upvotes: 1

C. K. Young
C. K. Young

Reputation: 223153

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

Upvotes: 7

Related Questions