The CertUtil program will decode Windows error codes, and in a variety of formats

Raymond Chen

Some time ago, I noted that The NET HELPMSG command will decode Windows error codes, at least the simple ones.

Stefan Kanthak pointed out that there’s another built-in program for converting numbers to error messages, and it handles a lot more error numbers and formats than NET HELPMSG does.

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

The first one says

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

The others say the same thing, but with a different error number:

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