为CMD.EXE%ERRORLEVEL%9009官方MS参考 [英] Official MS reference for cmd.exe %errorlevel% 9009

查看:1866
本文介绍了为CMD.EXE%ERRORLEVEL%9009官方MS参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我从运行cmd.exe的从一个有效的程序和检查经验,了解%ERRORLEVEL%会返回一个0:

So I know from experience that running a valid program from cmd.exe and checking the %errorlevel% will return a 0:

C:\>dir logo.bmp
 Volume in drive C has no label.
 Volume Serial Number is 5283-A7A2

 Directory of C:\

05/22/2008  12:43 PM         1,440,054 logo.bmp
               1 File(s)      1,440,054 bytes
               0 Dir(s)  71,723,995,136 bytes free

C:\>echo %errorlevel%
0

同样,试图执行一个不存在的命令,然后为%的误差code%检查给了我9009:

Likewise, trying to execute a command that does not exist and then checking for the %errorcode% gives me a 9009:

C:\>idontexist.exe
'idontexist.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\>echo %errorlevel%
9009

我已经写批处理脚本多年,他们一直努力这样。然而,有人问起兼容性这一技术的问题(向前和向后),我无法找到微软实际上定义9009的错误级别时未找到文件或程序的任何正式文件。我来最接近的是这个网站(<一个href=\"http://msdn.microsoft.com/en-us/library/ms681381%28v=vs.85%29.aspx\">http://msdn.microsoft.com/en-us/library/ms681381(v=vs.85).aspx)其中,不幸的是,列出9009作为DNS错误。

I've been writing batch scripts for years and they have always worked this way. However, someone has asked questions about compatibility (both forward and backward) of this technique and I can't find any official documentation from Microsoft actually defining 9009 as the errorlevel when a file or program is not found. The closest I've come is this site (http://msdn.microsoft.com/en-us/library/ms681381(v=vs.85).aspx) which, unfortunately, lists 9009 as a DNS error.

有谁知道这个行为是由Microsoft记录?

Does anyone know where this behavior is documented by Microsoft?

推荐答案

在Exchange的团队做了一个的常见错误查找工具将翻译错误codeS(包括的HRESULT,这是方便)为您。对于9009的输出是:

The Exchange team put out a Common Error Lookup Tool that will translate error codes (including HRESULTs, which is handy) for you. The output for 9009 is:

# for decimal 9009 / hex 0x2331 :
  MSG_DIR_BAD_COMMAND_OR_FILE                                   cmdmsg.h       
# '%1' is not recognized as an internal or external command,
# operable program or batch file.
  SQL_9009_severity_10                                          sql_err        
# Cannot shrink log file %d (%s) because of minimum log space
# required.
  DNS_ERROR_RCODE_NOTAUTH                                       winerror.h     
# DNS server not authoritative for zone.
# for hex 0x9009 / decimal 36873 :
  SSLEVENT_NO_CIPHERS_SUPPORTED                                 lsapmsgs.mc    
# No suitable default server credential exists on this
# system. This will prevent
# server applications that expect to make use of the system
# default credentials
# from accepting SSL connections. An example of such an
# application is the directory
# server. Applications that manage their own credentials,
# such as the internet
# information server, are not affected by this.
# 4 matches found for "9009"

...所以你要找的人是从cmdmsg.h。

...so the one you're looking for is from cmdmsg.h.

它不是真正的文件的本身,但它至少官方的。

It's not really documentation, per se, but it's at least official.

这篇关于为CMD.EXE%ERRORLEVEL%9009官方MS参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆