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.

9 comments

Discussion is closed. Login to edit/delete existing comments.

  • Dominik Rauch 0

    Just use hresult.info 🙂

    • Brian Boorman 0

      Building upon yesterday’s ONT topic, search your hresult.info site for the error message 0x80070bfe.

      https://www.hresult.info/Search?q=0x80070bfe

      Results:

      Search results for "0x80070bfe"
      No result for this search.

      Yeah. That’s useful.

    • Stefan Kanthak 0

      All error codes are HRESULTs?
      NTSTATUS codes ain’t, for example!

      • Tim Weis 0

        NTSTATUS codes can be encoded as HRESULT values, though. Just like Win32 system error codes. Uniquely identifiable as such, too. While indeed not every error code is in fact an HRESULT, every error code in Windows can be encoded as an HRESULT.

  • Mike Morrison 0

    I prefer err.exe, but if you have to stick to the built-in tools, then it sounds like certutil is good way to go. I had no idea that it could look up error codes.

    • Peter Cooper Jr. 0

      Certutil is also handy if you’re looking for a way to get a hash of a file (to validate a download or the like)

      certutil -hashfile file.txt sha256

      I’m pretty sure I’ve used certutil a lot more often for things completely unrelated to certs than for anything related to them.

  • Petr Kadlec 0

    So, does it help for yesterday’s blogpost error for which net helpmsg does not work?

    > certutil /error 0x80070bfe
    0x80070bfe (WIN32: 3070) -- 2147945470 (-2147021826)
    Error message text: memory
    
    > certutil /error 0x80070bfd
    0x80070bfd (WIN32: 3069) -- 2147945469 (-2147021827)
    Error message text: Error 0x80070bfd (WIN32: 3069)
    

    Nope. So, I wonder – where do the error messages quoted yesterday come from?

    • Mike Morrison 0

      Err.exe v6.4.5 reports the following for those two hresults:
      C:\Tools>Err_6.4.5.exe 0x80070bfe
      # No results found for hex 0x80070bfe / decimal -2147021826
      # anonymous HRESULT: Severity: FAILURE (1), Facility 0x7, Code 0xbfe
      # for hex 0xbfe / decimal 3070
      BC_BLUETOOTH_VERIFIER_FAULT bugcodes.h
      SERVICE_UIC_M_MEMORY lmsvc.h
      # 2 matches found for “0x80070bfe”

      C:\Tools>Err_6.4.5.exe 0x80070bfd
      # No results found for hex 0x80070bfd / decimal -2147021827
      # anonymous HRESULT: Severity: FAILURE (1), Facility 0x7, Code 0xbfd
      # for hex 0xbfd / decimal 3069
      EVENT_GATHER_RESTORE_COMPLETE windowssearcherrors.h
      # The application was successfully restored.%1
      # 1 matches found for “0x80070bfd”

    • joshieecs 0

      They come up for me. I’m on Windows 11.

      ╰─ certutil -error 0x80070bfe
      0x80070bfe (WIN32: 3070) -- 2147945470 (-2147021826)
      Error message text: The caller specified wait timed out before the operation completed because a host termination is in queued.
      CertUtil: -error command completed successfully.
      ╰─ certutil -error 0x80070bfd
      0x80070bfd (WIN32: 3069) -- 2147945469 (-2147021827)
      Error message text: The caller specified wait timed out before the operation completed.
      CertUtil: -error command completed successfully.

Feedback usabilla icon