为什么 Hudson 不识别 xcopy 作为命令?

发布于 2024-07-27 12:47:59 字数 512 浏览 9 评论 0原文

我的 hudson 构建步骤中有一个 Windows 批处理命令,基本上是:

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

复制失败:

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

但是,xcopy 可在命令行上使用(与复制一样)。 我需要做什么才能让 hudson 使用 xcopy?

编辑:我的路径

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

可能就是它从命令行工作的原因。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁与争疯 2024-08-03 12:47:59

xcopy 位于您的 system32 目录中; 确保它位于您的 PATH 中。

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

筱武穆 2024-08-03 12:47:59

当将 Xcopy 与 Hudson(或其他构建系统)一起使用时,您可能需要注意的是被复制文件的路径总长度。

就我而言,我遇到了使用 xcopy 复制埋藏在目录结构中多个级别的文件的问题,这样当与 Hudson 的工作/构建路径级别结合使用时,它(我假设)超出了最大允许路径长度供 xcopy 使用。 我当前的解决方法是在复制构建输出之前简单地对其进行压缩,但我正在寻找更干净的东西。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文