dos中一些常用命令的errorlevel返回值
ATTRIB.EXE
(a) Target file/folder not found = ERRORLEVEL 1
(b) Invalid switch = ERRORLEVEL 1
(c) Sharing violation (target file in use) = ERRORLEVEL 1
(d) Invalid drive specification = ERRORLEVEL 1
(e) Drive not ready (either Abort or Fail reply) = ERRORLEVEL 1
(f) Invalid/wrong number of parameters = ERRORLEVEL 1
EXTRACT.EXE
(a) Invalid switch = ERRORLEVEL 1
FC.EXE
(a) Insufficient number of filespecs = ERRORLEVEL 1
(b) Too many filenames on command line = ERRORLEVEL 1
(c) Sharing Violation + Abort reply = ERRORLEVEL 5
(Note: Fail reply returns ERRORLEVEL 0)
(d) Drive not ready = ERRORLEVEL 18
(Note: Fail reply returns ERRORLEVEL 0)
FIND.EXE
(a) Target string found (=f0und) = ERRORLEVEL 0
(b) Target string missing (=m1ssing) = ERRORLEVEL 1
(c) find /? = ERRORLEVEL 1
(d) Parameter format not correct = ERRORLEVEL 2
(e) Specified file to search not found = ERRORLEVEL 2
(f) Specified file in use + Fail reply = ERRORLEVEL 2
(g) Drive not ready + Fail reply = ERRORLEVEL 2
(h) Specified file in use + Abort reply = ERRORLEVEL 5
(i) Drive not ready + Abort reply = ERRORLEVEL 5
FORMAT.COM
(a) Drive not ready = ERRORLEVEL 4
(There is no Abort, Retry, Fail stall)
FTP.EXE
(a) Brief help (use: ftp -h for Brief help) = ERRORLEVEL 2
(b) Error opening script file (file missing) = ERRORLEVEL 2
(c) Invalid switch = ERRORLEVEL 2
MORE.COM
(a) Invalid switch (MORE doesn't accept switches) = ERRORLEVEL 1
(b) Drive not ready (Abort reply) = ERRORLELEL 5
(Note: Fail reply returns ERRORLEVEL 0)
MOVE.EXE
(a) Required parameter missing = ERRORLEVEL 1
(b) Unable to create destination = ERRORLEVEL 1
(c) Unable to open source = ERRORLEVEL 1
(you see this when trying to MOVE a folder from one drive
to another. You need to use XCOPY /S followed by DELTREE,
since MOVE won't handle folder moves across drives)
(d) Sharing violation + Fail reply = ERRORLEVEL 1
(Note: file is nevertheless COPIED, not moved, in this case)
(e) Sharing violation + Abort reply = ERRORLEVEL 5
(Note: file is nevertheless COPIED, not moved, in this case)
(f) Drive not ready (Abort reply) = ERRORLEVEL 18
(Note: Fail reply - unusually - returns ERRORLEVEL 1)
PING.EXE
(a) Unknown host = ERRORLEVEL 1
(usually=name not found on DomainNameServer)
(b) Brief help (with no parameter) = ERRORLEVEL 1
Note: for PING Brief help with /? switch, ERRORLEVEL is 0
(c) Invalid switch = ERRORLEVEL 1
(and displays the Brief help as well)
(d) Interrupted with [Ctrl-C] = ERRORLEVEL 255
SORT.EXE
(a) Invalid switch = ERRORLEVEL 1
(b) Drive not ready (Abort reply) = ERRORLEVEL 15
(Note: Fail reply returns ERRORLEVEL 0)
START.EXE
(a) start /? (real mode) = ERRORLEVEL 1
(b) start /? (GUI) = ERRORLEVEL 255
(c) Can't find file specified for START = ERRORLEVEL 255
(d) No file association for specified file = ERRORLEVEL 255
(e) Drive not ready = ERRORLEVEL 255
(There is no Abort, Retry, Fail stall)
SUBST.EXE
(a) Invalid parameter = ERRORLEVEL 1
(b) Invalid switch = ERRORLEVEL 1
(c) Path not found = ERRORLEVEL 1
(d) Drive not ready (Abort reply) = ERRORLEVEL 21
(Note: Fail reply - unusually - returns ERRORLEVEL 1)
TRACERT.EXE
(a) Unable to resolve target system name = ERRORLEVEL 1
(usually=name not found on DomainNameServer)
(b) Invalid switch = ERRORLEVEL 1
(c) Brief help (no parameter) = ERRORLEVEL 1
(d) Interrupted with [Ctrl-C] = ERRORLEVEL 255
Note: for TRACERT Brief help, type command without parameters
XCOPY.EXE
(a) File not found = ERRORLEVEL 1
(b) Invalid date in /d switch = ERRORLEVEL 4
(c) Invalid number of parameters = ERRORLEVEL 4
(d) Invalid parameter = ERRORLEVEL 4
(e) Device not ready = ERRORLEVEL 4
(f) Unable to create directory = ERRORLEVEL 4
(g) System can't find file = ERRORLEVEL 5
(this occurs when device such as NUL is used as Source file)
上一篇:批处理中常用命令介绍(Echo、rem、goto、call、pause、if、for)
栏 目:DOS/BAT
下一篇:使用BAT批处理在RAR压缩文件中批量添加文件的方法
本文地址:https://www.xiuzhanwang.com/a1/DOS_BAT/10191.html
您可能感兴趣的文章
- 01-10DOS下查看硬盘分区该使用什么命令
- 01-10再谈DOS批处理下格式化日期字符串的三种方法(详解)
- 01-10dos命令行不能输入中文怎么办该如何解决
- 01-10批处理输出n阶幻方脚本
- 01-10dos批处理文件中的变量小结
- 01-10DOS中的pause命令简介
- 01-10批处理中Copy与Xcopy命令的区别小结
- 01-10dos中RD命令递归删除目录的代码
- 01-10DOS下如何声明变量(定义变量)
- 01-10dos变量定义和引用方法
阅读排行
本栏相关
- 01-10DOS下查看硬盘分区该使用什么命令
- 01-10使用批处理实现软件的自动安装以安
- 01-10后台运行bat定时器程序示例分享
- 01-10通过批处理修改DNS的代码(推荐)
- 01-10dota2服务器ping测试脚本分享
- 01-10再谈DOS批处理下格式化日期字符串的
- 01-10windows使用批处理发布web到tomcat并启动
- 01-10win7怎么设定关闭显示器时间
- 01-10屏蔽up键禁止游戏运行脚本分享
- 01-10win7创建wifi热点脚本分享
随机阅读
- 01-10delphi制作wav文件的方法
- 01-10C#中split用法实例总结
- 08-05DEDE织梦data目录下的sessions文件夹有什
- 01-10SublimeText编译C开发环境设置
- 01-11Mac OSX 打开原生自带读写NTFS功能(图文
- 08-05dedecms(织梦)副栏目数量限制代码修改
- 08-05织梦dedecms什么时候用栏目交叉功能?
- 01-11ajax实现页面的局部加载
- 01-10使用C语言求解扑克牌的顺子及n个骰子
- 04-02jquery与jsp,用jquery