Robocopy返回值

[摘自] http://blog.youkuaiyun.com/kapuliyuehan/article/details/6738025

 

Robocopy Errorlevel Return Codes (found in robocopy.doc)

The return code from Robocopy is a bit map, defined as follows:

0×10 Serious error. Robocopy did not copy any files. This is either a usage error or an error due to insufficient access privileges on the source or destination directories.
0×08 Some files or directories could not be copied (copy errors occurred and the retry limit was exceeded). Check these errors further.
0×04 Some Mismatched files or directories were detected. Examine the output log. Housekeeping is probably necessary.
0×02 Some Extra files or directories were detected. Examine the output log. Some housekeeping may be needed.
0×01 One or more files were copied successfully (that is, new files have arrived).
0×00 No errors occurred, and no copying was done. The source and destination directory trees are completely synchronized.


如果使用hudson、cruisecontrol之类的软件使用robocopy,由于robocopy正常拷贝下返回值不是0,这些软件都会报错。因此,使用如下语句进行重设置返回值:

if %ERRORLEVEL% LEQ 7 set ERRORLEVEL=0

或者单独设置

if ERRORLEVEL 1 set ERRORLEVEL=0
if ERRORLEVEL 2 set ERRORLEVEL=0
if ERRORLEVEL 3 set ERRORLEVEL=0 
if ERRORLEVEL 5 set ERRORLEVEL=0 
if ERRORLEVEL 6 set ERRORLEVEL=0 
if ERRORLEVEL 7 set ERRORLEVEL=0 

 

 

 

(pythonProject2) PS V:\ALIDownload\人脸识别> python V:\ALIDownload\人脸识别\人脸识别\generate_model.py C:\Users\tinking\miniconda3\envs\pythonProject2\lib\site-packages\face_recognition_models\__init__.py:7: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. from pkg_resources import resource_filename 2025-10-25 20:45:08,745 - INFO - === 步骤1: 转换问题图像 === 2025-10-25 20:45:08,745 - INFO - 开始批量转换图像: V:\ALIDownload\人脸识别\人脸识别\faces\2 2025-10-25 20:45:08,775 - INFO - 转换成功: DM_20251024155234_001.jpg -> DM_20251024155234_001.jpg 2025-10-25 20:45:08,785 - INFO - 转换成功: DM_20251024155625_001.jpg -> DM_20251024155625_001.jpg 2025-10-25 20:45:08,795 - INFO - 转换成功: 微信图片_20251024154355.jpg -> 微信图片_20251024154355.jpg 2025-10-25 20:45:08,795 - INFO - 转换成功: 证件.jpg -> 证件.jpg 2025-10-25 20:45:08,795 - INFO - === 步骤2: 生成人脸模型 === Traceback (most recent call last): File "V:\ALIDownload\人脸识别\人脸识别\generate_model.py", line 240, in <module> os.rename(original_faces_dir, backup_dir) PermissionError: [WinError 5] 拒绝访问。: 'V:\\ALIDownload\\人脸识别\\人脸识别\\faces' -> 'V:\\ALIDownload\\人脸识别\\人脸识别\\faces_backup' (pythonProject2) PS V:\ALIDownload\人脸识别>
最新发布
10-26
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值