CertUtil程序将可解码Windows错误代码,并可使用多种形式

原文地址:The CertUtil program will decode Windows error codes, and in a variety of formats – The Old New Thing (microsoft.com)September 21st, 2021

前段时间,我注意到The NET HELPMSG command will decode Windows error codes, at least the simple ones.

Stefan Kanthak指出,还有另一个内置程序可以将数字转换为错误消息,它处理的错误数字和格式比NET HELPMSG多得多。

certutil /error 2
certutil /error 0x80070002
certutil /error -2147024894
certutil /error 2147942402
certutil /error -0x7ff8fffe

第一个显示:

0x2 (WIN32: 2 ERROR_FILE_NOT_FOUND) -- 2 (2)
Error message text: The system cannot find the file specified.
CertUtil: -error command completed successfully.

另外几条说的是同样的事情,但错误号不同:

0x80070002 (WIN32: 2 ERROR_FILE_NOT_FOUND) -- 2147942402 (-2147024894)
Error message text: The system cannot find the file specified.
CertUtil: -error command completed successfully.