dos中一些常用命令的errorlevel返回值
来源: 阅读:712 次 日期:2016-06-20 09:50:32
温馨提示: 小编为您整理了“dos中一些常用命令的errorlevel返回值”,方便广大网友查阅!

这篇文章主要介绍了dos中一些常用命令的errorlevel返回值,方便大家在bat中方便判断

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)

更多信息请查看 脚本栏目
由于各方面情况的不断调整与变化, 提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们| 联系我们| 人才招聘| 网站声明| 网站帮助| 非正式的简要咨询| 简要咨询须知| 加入群交流| 手机站点| 投诉建议
工业和信息化部备案号:滇ICP备2023014141号-1 云南省教育厅备案号:云教ICP备0901021 滇公网安备53010202001879号 人力资源服务许可证:(云)人服证字(2023)第0102001523号
云南网警备案专用图标
联系电话:0871-65317125(9:00—18:00) 获取招聘考试信息及咨询关注公众号:
咨询QQ:526150442(9:00—18:00) 版权所有:
云南网警报警专用图标
Baidu
map