原文地址:[url]http://blogs.technet.com/deploymentguys/archive/2008/06/16/robocopy-exit-codes.aspx[/url]

Robocopy exit codes

Robocopy is a great tool, and I often use it in a deployment project for moving files around; I think the most useful feature it has is the /MIR switch.  It lets you update the contents of a folder, only copying the files that have changed or are missing.
robocopy是一个非常棒的工具,我常常在部署工程中用他来移动文件。我想他最有用的一个特性就是/MIR参数。它让我们可以仅仅更新一个文件夹里遗失或改变的文件。
One problem with the use of Robocopy in the task sequence is that it doesn't always return an error code of 0, even if the copy has been successful.  This can give a problem if you have your task sequence set up similar to the screenshot below.  As you can see, I have added the Robocopy command direct to the task sequence, and I have left the default "Success codes" on the options tab.  This works fine for most scenarios, but with Robocopy you might find that your deployment fails stating that Robocopy returned a non-success code, even though the copy appears to have been successful.
在TS中,robocopy有一个问题——它并不是总是返回错误代码0,甚者copy已经成功。这就带来一个麻烦:如下图所示,我将robocopy命令行直接加入TS中,使用了默认的成功代码,在大多数案例中,他正常工作,但在robocopy里,你会发现部署失败,显示robocopy并不返回一个成功代码,尽管有时copy是成功的。
There are several ways to fix this, but the way I prefer is to add the additional success codes to the task sequence, that way it will only fail if a genuine error occurs.  So, below I have included a list I compiled of the codes I have come across (I have included the non-success codes I have seen for completion).  Feel free to comment on this post if you can help expand the list!
有许多办法来解决这个问题,我倾向于添加额外的成功代码,只有真的发生错误时才会失败,下面我总结了我曾经遇到过的代码(非成功代码)
Code Meaning
0 No errors occurred and no files were copied.
1 One of more files were copied successfully.
2 Extra files or directories were detected.  Examine the log file for more information.
4 Mismatched files or directories were detected.  Examine the log file for more information.
8 Some files or directories could not be copied and the retry limit was exceeded.
16 Robocopy did not copy any files.  Check the command line parameters and verify that Robocopy has enough rights to write to the destination folder.
I strongly recommend that you use the /LOG parameter with Robocopy in order to create a complete log file of the process.  This file is invaluable for finding out what went wrong.
我强烈建议你使用/log参数,robocopy会建立一个完整的日志文件,这在排错时很有用
This post was contributed by Daniel Oxley a consultant with Microsoft Services Spain
Published Monday, June 16, 2008 8:51 AM by DeploymentGuys

转载于:https://blog.51cto.com/xmuxsp/82430

robocopy的退出返回代码相关推荐

  1. MSB3721 命令““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe“ 已退出 返回代码为1

    MSB3721    命令""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe" ...

  2. c++注意点(刷题笔记)

    C/C++编程注意点 1.gets和scanf连用 如果在scanf后用gets需要注意一点,gets是遇到'\n'直接返回,而输入scanf后回车会将'\n'留在输入缓存里, 而gets正好遇到'\ ...

  3. 数据结构(2021-5-13)

    exit(0)是什么意思 exit(0)的意思指的是正常状态退出. exit()就是退出,传入的参数是程序退出时的状态码,0表示正常退出,其他表示非正常退出.退出程序,括号中的0表示程序的退出返回代码 ...

  4. 【C语言】猜数字小游戏详细教程

    大家好!我是同学[森],一名计算机爱好者,今天让我们进入小游戏开发模式.若有错误,请多多指教.小主使用的是VS2019编译器. 由于小主是大一学生,知识掌握水平有限,代码可能会有写漏洞和不足,仅供借鉴 ...

  5. 2021-06-20活期账目储蓄管理系统

    数据结构链表之活期账目储蓄管理系统(C++) 活期储蓄账目管理系统 1 问题内容与目的要求 (1)结构背景 链表是一种链式存储的数据结构,是用一组地址任意的存储单元存放线性表中的数据元素,链表中的数据 ...

  6. vs2017 自定义生成规则 错误 MSB3721 命令 ”已退出,返回代码为 1。

    错误 MSB3721 命令 "已退出,返回代码为 1. 解决办法:去掉yasm复选框,改为masm vs2017 自定义生成规则-编译汇编代码 VC++调用yasm编译汇编代码有三种方法:C ...

  7. nvcc 已退出,返回代码为1

    报错: 原因: 1.cuda库目录版本写错了 把库目录改对就行了. 2. include目录写错了. 原因是: cuda toolkit custom dir 不用填,我填错了.

  8. 复制命令(ROBOCOPY)

    ROBOCOPY 命令: // 描述: 相比较 xcopy.copy 来说,复制的功能就强大很多,  xcopy.copy 是单线程的,robocopy是多线程的,但是和一些专业的复制软件相比速度还是 ...

  9. Robocopy.exe使用详例

    Robocopy.exe 是 微软在Windows server 2003 Resource Kit Tools 里面提供的程序来做备份的.Vista,Win2008已经自带了. Microsoft ...

最新文章

  1. linux记录用户命令的日志是,用日志记录Linux用户执行的每一条命令
  2. 一种网络进程间通信的方式—— 管道
  3. C#中多线程和定时器是不是有冲突?
  4. 后悔!我早该把这1W字详解的 InnoDB 原理给你!
  5. 打印日志的10个建议
  6. mysql+inser+select_解析MySQL中INSERT INTO SELECT的使用
  7. 免费wordpress主题在线生成网站
  8. JavaScript和Java的区别
  9. STM32 I2C通信(读写eeprom)
  10. https证书设置以及设置301跳转
  11. WebService 出现因 URL 意外地以“/HelloWorld”结束,请求格式无法识别。
  12. Excel自动化报表制作
  13. 关闭445端口bat脚本
  14. QT学习11:clicked和toggled信号
  15. 平板安装Ubuntu18.04教程
  16. pwm一个时间单位_「硬见小百科」什么是PWM“死区”?
  17. lower_bound,upper_bound的第四个参数
  18. 破除对于XP半开连接数限制的误解
  19. [C语言源代码][数据存储+指针] 谁还不会司空震?给我冲!
  20. Android同时按下多个按钮

热门文章

  1. 安卓学习笔记36:内容提供者
  2. 安卓学习笔记34:默默工作的服务
  3. 16软件1班安卓第二学期学习总结
  4. Java讲课笔记23:Map接口及其实现类
  5. 《天天数学》连载13:一月十三日
  6. 大数据学习笔记06:伪分布式Hadoop
  7. 专业英语笔记:Spring框架
  8. 【BZOJ3238】差异,后缀数组+单调栈维护height
  9. 【BZOJ1257】余数之和sum,数论练习之取值讨论
  10. 【Python】理解Python(1) - Python数据模型,is关键字,类型