5

I have a program that calls the dism.exe program and it runs a few commands in the background. Right now, I only check for a return code of 0 or anything else in order to show a process failed or succeeded. What could i cross examine the return code with in order to get an accurate return error. Which returns are the DISM referenced to?

Tyler
  • 51
  • 1
  • 3
  • You might wanna look as the DISM API, there is also a section on error codes for troubleshooting https://msdn.microsoft.com/en-us/library/windows/desktop/hh825833(v=vs.85).aspx – Dirk Vollmar Jul 28 '16 at 18:34
  • I googled around for probably 20 minutes, and this page never came up once...Thank you – Tyler Jul 28 '16 at 19:24
  • Well, it's actually the first hit when you enter your question title into Google ;-) – Dirk Vollmar Jul 28 '16 at 19:47

1 Answers1

2

The link provided in the comment DISMAPI Error Messages provides a very few error code, but in my experience, these are not the most common error codes returned by DISM.exe.

In my scenarios, I mostly use dism.exe /Online ... and here's what I found so far:

  • ERROR_SUCCESS_REBOOT_REQUIRED ~ 3010 (0xBC2) when /Add-Package requires a reboot.
  • ERROR_BAD_FORMAT ~ 11 (0xB) when you hand /Add-Package a package that is not applicable to this operating system (e.g. an x86 package for a x64 Windows)
  • ERROR_PATH_NOT_FOUND ~ 3 when the file you hand to /PackagePath doesn't exist
  • ERROR_ELEVATION_REQUIRED ~ 740 (0x2E4) when you're not running as admin.

Additional Links:

Martin Ba
  • 37,187
  • 33
  • 183
  • 337