Sign in to follow this  
Followers 0
engjcowi

Check for problems in Device Manager

12 posts in this topic

Hi guys

I did this a little while ago. Its dirty code but works and thats all i need right now (well its worked for me so far on 3 computers). This will check if there are any errors in the device manager and if so tell you. I appreciate this isnt the best code youve seen lol and any improvements are always welcome. If you have any errors please let me know.

Thanks

Jamie

#RequireAdmin
;==================================================================================
; function is used to determine if there are any issues in the device manager
;==================================================================================
 
    Dim $bProblemsExist, $bDisabledExist, $Code = "", $codemsg = ""
    $bProblemsExist = false
    $bDisabledExist = false
$strComputer = "."
 
DeviceProblems()
If $bDisabledExist = False And $bProblemsExist = False Then
  $codemsg = "Device Manager is Clean"
msgbox(4096,$Code,$codemsg)
Else
msgbox(4096,$Code,$codemsg)
    EndIf
 
 
Func DeviceProblems()
$DEVobjWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")
$DEVcolItems = $DEVobjWMIService.ExecQuery("Select * from Win32_PnPEntity " & "WHERE ConfigManagerErrorCode <> 0")
 
For $DEVobjItem in $DEVcolItems
  if $DEVobjItem.ConfigManagerErrorcode = 1 Then
   $bProblemsExist = True
   $Code = "System Failure - No Config"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel"
  Elseif $DEVobjItem.ConfigManagerErrorcode = 2 Then
   $bProblemsExist = True
   $Code = "Device could not load driver"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 3 Then
   $bProblemsExist = True
   $Code = "System Failure - Run Out of Memory"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 4 Then
   $bProblemsExist = True
   $Code = "Device Failure - Devloader/Static VxD/Configured is of Wrong Type."
   $codemsg = "This code indicates that the .inf file for this device may be incorrect or the registry may be damaged. This error code is displayed if the .inf file specifies a field that should be text, but is binary instead. In addition to following the recommended suggestions, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, please contact the hardware's manufacturer for an updated .inf file. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 5 Then
   $bProblemsExist = True
   $Code = "Device Failure - Lacked an Arbitrator."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 6 Then
   $bProblemsExist = True
   $Code = "Boot config Conflicted."
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 7 Then
   $bProblemsExist = True
   $Code = "Filtering Failed - Possible problem in Device Driver Code."
   $codemsg = "If the device works correctly, you do need not to perform any steps to correct the code. If the device does not work correctly, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If you continue to receive this error code and the device does not function properly, check with the hardware manufacturer for an updated driver. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 8 Then
   $bProblemsExist = True
   $Code = "System failure - Devloader Not Found"
   $codemsg = "If you are receiving an error about Devloader, there is no known resolution. If you are receiving any other error, reinstall the driver or update the driver. If you are getting an error with a System Devloader, Windows should be reinstalled because the Devloader is built into the Vmm32.vxd."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 9 Then
   $bProblemsExist = True
   $Code = "Invalid Data in Registry."
   $codemsg = "This code means that the information in the registry for this device is invalid. It may be possible to resolve this error by using Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer for the proper registry settings or updated drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 10 Then
   $bProblemsExist = True
   $Code = "Device Failed to start."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 11 Then
   $bProblemsExist = True
   $Code = "Device Failure."
   $codemsg = "To resolve this error, run the Automatic Skip Driver utility from the System Information tool. If the problem persists, contact the hardware manufacturer for updated drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 12 Then
   $bProblemsExist = True
   $Code = "Was normal conflicting - One of the resource arbitrators returned a failure. "
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 13 Then
   $bProblemsExist = True
   $Code = "System Failure - Possible problem in Device Driver or Windows 95 Code. "
   $codemsg = "This code indicates that the device driver did not find the hardware. To resolve this error code, first ensure the device is properly installed. As an alternative, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 14 Then
   $bProblemsExist = True
   $Code = "Need to restart your computer for this device to be re setup or to be finished installed."
   $codemsg = "Restart the computer"
  Elseif $DEVobjItem.ConfigManagerErrorcode = 15 Then
   $bProblemsExist = True
   $Code = "This device is causing a resource conflict."
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 16 Then
   $bProblemsExist = True
   $Code = "Was not fully detected, not all detected."
   $codemsg = "Double-click on the device, click the Resources tab and manually enter the settings. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 17 Then
   $bProblemsExist = True
   $Code = "Device failure - Resource number was not found."
   $codemsg = "This code means that the hardware is a multiple-function device and the .inf file for the device is providing invalid information on how to split the device's resources to the child devices. To resolve this error code, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer about an updated .inf file. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 18 Then
   $bProblemsExist = True
   $Code = "Reinstall."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 19 Then
   $bProblemsExist = True
   $Code = "System Failure - Registry returned unknown result"
   $codemsg = "Problem in the registry. If you have Windows 95 and you have not made a backup of the registry you will need to reinstall Windows.If you have Windows 98: To resolve this issue, follow the recommended solution, which will run Scanreg.exe. If this does not resolve the issue, type scanreg /restore from C:\Windows\COMMAND. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 20 Then
   $bProblemsExist = True
   $Code = "System Failure - VxDLdr Returned Unknown Result."
   $codemsg = "This code means VxD Loader (Vxdldr) returned an unknown result. For example, there could a version mismatch between the device driver and the operating system driver. Update the driver. If that does not work, try removing the device from Device Manager and then running the Add New Hardware Wizard in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 21 Then
   $bProblemsExist = True
   $Code = "Will Be Removed."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 22 Then
   $bDisabledExist = True
   $Code = "This device is disabled."
   $codemsg = "Double-click on the device and Enable. If this does not work, update the driver. If this also does not work, remove the device and reinstall through Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 23 Then
   $bProblemsExist = True
   $Code = "Device Failure - Devloader was not ready."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 24 Then
   $bProblemsExist = True
   $Code = "Device not Found, This device is either missing or not working properly."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 25 Then
   $bProblemsExist = True
   $Code = "Was Moved - Possible problem in device driver code."
   $codemsg = "Attempt first to restart the computer at least two times, if you continue to get this error, Reinstall Windows."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 26 Then
   $bProblemsExist = True
   $Code = "Device Failure."
   $codemsg = "First restart the computer. If this does not resolve the issue, check for updated drivers. In some cases, this issue may also be resolved by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 27 Then
   $bProblemsExist = True
   $Code = "Device failure - No Valid Log configuration"
   $codemsg = "This code means that the portion of the registry describing possible resources for a device does not contain valid entries. For example, the device is marked as configurable, but the configuration information in the .inf file is set to hardwired. To resolve this error code, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If the device still does not work, consult the hardware manufacturer for updated drivers or further assistance. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 28 Then
   $bProblemsExist = True
   $Code = "Failed Installation - This device was not installed completely."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 29 Then
   $bProblemsExist = True
   $Code = "Hardware Disabled - This device does not work and cannot be made to work."
   $codemsg = "Ensure that the device is not disabled through BIOS. Many times Windows cannot override settings in the BIOS. If the device is enabled there is no other known resolution."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 30 Then
   $bProblemsExist = True
   $Code = "Cant Share IRQ."
   $codemsg = "A PCI/EISA SCSI controller is sharing an IRQ that is also in use by a real-mode device driver set not to be overwritten. Remove the real mode driver that is using the same IRQ as the device from the config.sys or autoexec.bat."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 31 Then
   $bProblemsExist = True
   $Code = "<device> is not working properly."
   $codemsg = "The properties button displays the properties for the other device. More than likely the other device will also have one of these Device Manager error codes. Follow all the recommended solutions. If the devices still do not work remove the devices from Device Manager and use the Add New Hardware wizard in Control Panel to redetect them. Finally, verify that your devices have the latest drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 32 Then
   $bProblemsExist = True
   $Code = "Cannot install the device because cannot access the Networked drive."
   $codemsg = "First, restart the computer. If this does not resolve your issue, verify that the device you are attempting to copy from is properly working. If the device is working, verify you have the latest drivers from the manufacturer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 33 Then
   $bProblemsExist = True
   $Code = "Device is not responding."
   $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 34 Then
   $bProblemsExist = True
   $Code = "The device requires manual configuration."
   $codemsg = "Set the jumpers for the device and configure the device manually through Device Manager. If this device has worked in the past and has stopped working uninstall any recently installed programs."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 35 Then
   $bProblemsExist = True
   $Code = "BIOS does not contain necessary resource assignments."
   $codemsg = "Obtain the latest BIOS update."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 36 Then
   $bProblemsExist = True
   $Code = "IRQ translation failed."
   $codemsg = "Adjust the IRQ reservation settings in CMOS (BIOS) setup."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 37 Then
   $bProblemsExist = True
   $Code = "The DriverEntry routine failed when attempted by this driver."
   $codemsg = "Download and install the latest driver for the device with the error. If you're running the 64-bit version of Windows, make sure you're installing a 64-bit driver and not a 32-bit driver."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 38 Then
   $bProblemsExist = True
   $Code = "The driver cannot load because a previous instance is still loaded."
   $codemsg = "Restart the computer. If after restarting the computer the issue persists, download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 40 Then
   $bProblemsExist = True
   $Code = "Information in the registry entry for this driver is invalid."
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 41 Then
   $bProblemsExist = True
   $Code = "A driver was loaded but Windows cannot find the device. "
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 42 Then
   $bProblemsExist = True
   $Code = "Bus driver has created two devices with the same names."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 43 Then
   $bProblemsExist = True
   $Code = "A device driver notified the operating system that the device failed."
   $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 44 Then
   $bProblemsExist = True
   $Code = "The device driver was stopped by other software on the computer."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 45 Then
   $bProblemsExist = True
   $Code = "The device is not present or was previously attached to the computer."
   $codemsg = "Re-attach the disconnected device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 46 Then
   $bProblemsExist = True
   $Code = "The device is not available because the computer is shutting down."
   $codemsg = "The computer is in the process of shutting down. When computer restarts the device should function as normal."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 47 Then
   $bProblemsExist = True
   $Code = "The device is ready for removal."
   $codemsg = "Unplug the hardware device and plug it back in or restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 48 Then
   $bProblemsExist = True
   $Code = "Driver incompatibility."
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 49 Then
   $bProblemsExist = True
   $Code = "The system hive has exceeded its maximum size and new devices cannot work until the size is reduced. "
   $codemsg = "Uninstall any un-used hardware devices."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 52 Then
   $bProblemsExist = True
   $Code = "The driver may be unsigned or corrupted. "
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Else
   $codemsg = "Device Manager is Clean"
  EndIf
ExitLoop
Next
 
EndFunc

Drunken Frat-Boy Monkey Garbage

Share this post


Link to post
Share on other sites



Very Nice idea.

One Addition that would be good is to add the name of the faulty device to the display.

Inside the For loop is you add

$Code = $DEVobjItem.name & " : "

and change each $code = to be $code &=

You'll get the name in the messages.

Here is your modified code below.

It cood come in usfull I'll add it to the tool box

THANKS

#RequireAdmin
;==================================================================================
; function is used to determine if there are any issues in the device manager
;==================================================================================
 
    Dim $bProblemsExist, $bDisabledExist, $Code = "", $codemsg = ""
    $bProblemsExist = false
    $bDisabledExist = false
$strComputer = "."
 
DeviceProblems()
If $bDisabledExist = False And $bProblemsExist = False Then
  $codemsg = "Device Manager is Clean"
msgbox(4096,$Code,$codemsg)
Else
msgbox(4096,$Code,$codemsg)
    EndIf
 
 
Func DeviceProblems()
$DEVobjWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")
$DEVcolItems = $DEVobjWMIService.ExecQuery("Select * from Win32_PnPEntity " & "WHERE ConfigManagerErrorCode <> 0")
 
For $DEVobjItem in $DEVcolItems
    $Code = $DEVobjItem.name & " : "
  if $DEVobjItem.ConfigManagerErrorcode = 1 Then
   $bProblemsExist = True
   $Code &= "System Failure - No Config"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel"
  Elseif $DEVobjItem.ConfigManagerErrorcode = 2 Then
   $bProblemsExist = True
   $Code &= "Device could not load driver"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 3 Then
   $bProblemsExist = True
   $Code &= "System Failure - Run Out of Memory"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 4 Then
   $bProblemsExist = True
   $Code &= "Device Failure - Devloader/Static VxD/Configured is of Wrong Type."
   $codemsg = "This code indicates that the .inf file for this device may be incorrect or the registry may be damaged. This error code is displayed if the .inf file specifies a field that should be text, but is binary instead. In addition to following the recommended suggestions, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, please contact the hardware's manufacturer for an updated .inf file. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 5 Then
   $bProblemsExist = True
   $Code &= "Device Failure - Lacked an Arbitrator."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 6 Then
   $bProblemsExist = True
   $Code &= "Boot config Conflicted."
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 7 Then
   $bProblemsExist = True
   $Code &= "Filtering Failed - Possible problem in Device Driver Code."
   $codemsg = "If the device works correctly, you do need not to perform any steps to correct the code. If the device does not work correctly, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If you continue to receive this error code and the device does not function properly, check with the hardware manufacturer for an updated driver. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 8 Then
   $bProblemsExist = True
   $Code &= "System failure - Devloader Not Found"
   $codemsg = "If you are receiving an error about Devloader, there is no known resolution. If you are receiving any other error, reinstall the driver or update the driver. If you are getting an error with a System Devloader, Windows should be reinstalled because the Devloader is built into the Vmm32.vxd."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 9 Then
   $bProblemsExist = True
   $Code &= "Invalid Data in Registry."
   $codemsg = "This code means that the information in the registry for this device is invalid. It may be possible to resolve this error by using Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer for the proper registry settings or updated drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 10 Then
   $bProblemsExist = True
   $Code &= "Device Failed to start."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 11 Then
   $bProblemsExist = True
   $Code &= "Device Failure."
   $codemsg = "To resolve this error, run the Automatic Skip Driver utility from the System Information tool. If the problem persists, contact the hardware manufacturer for updated drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 12 Then
   $bProblemsExist = True
   $Code &= "Was normal conflicting - One of the resource arbitrators returned a failure. "
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 13 Then
   $bProblemsExist = True
   $Code &= "System Failure - Possible problem in Device Driver or Windows 95 Code. "
   $codemsg = "This code indicates that the device driver did not find the hardware. To resolve this error code, first ensure the device is properly installed. As an alternative, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 14 Then
   $bProblemsExist = True
   $Code &= "Need to restart your computer for this device to be re setup or to be finished installed."
   $codemsg = "Restart the computer"
  Elseif $DEVobjItem.ConfigManagerErrorcode = 15 Then
   $bProblemsExist = True
   $Code &= "This device is causing a resource conflict."
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 16 Then
   $bProblemsExist = True
   $Code &= "Was not fully detected, not all detected."
   $codemsg = "Double-click on the device, click the Resources tab and manually enter the settings. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 17 Then
   $bProblemsExist = True
   $Code &= "Device failure - Resource number was not found."
   $codemsg = "This code means that the hardware is a multiple-function device and the .inf file for the device is providing invalid information on how to split the device's resources to the child devices. To resolve this error code, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer about an updated .inf file. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 18 Then
   $bProblemsExist = True
   $Code &= "Reinstall."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 19 Then
   $bProblemsExist = True
   $Code &= "System Failure - Registry returned unknown result"
   $codemsg = "Problem in the registry. If you have Windows 95 and you have not made a backup of the registry you will need to reinstall Windows.If you have Windows 98: To resolve this issue, follow the recommended solution, which will run Scanreg.exe. If this does not resolve the issue, type scanreg /restore from C:\Windows\COMMAND. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 20 Then
   $bProblemsExist = True
   $Code &= "System Failure - VxDLdr Returned Unknown Result."
   $codemsg = "This code means VxD Loader (Vxdldr) returned an unknown result. For example, there could a version mismatch between the device driver and the operating system driver. Update the driver. If that does not work, try removing the device from Device Manager and then running the Add New Hardware Wizard in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 21 Then
   $bProblemsExist = True
   $Code &= "Will Be Removed."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 22 Then
   $bDisabledExist = True
   $Code &= "This device is disabled."
   $codemsg = "Double-click on the device and Enable. If this does not work, update the driver. If this also does not work, remove the device and reinstall through Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 23 Then
   $bProblemsExist = True
   $Code &= "Device Failure - Devloader was not ready."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 24 Then
   $bProblemsExist = True
   $Code &= "Device not Found, This device is either missing or not working properly."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 25 Then
   $bProblemsExist = True
   $Code &= "Was Moved - Possible problem in device driver code."
   $codemsg = "Attempt first to restart the computer at least two times, if you continue to get this error, Reinstall Windows."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 26 Then
   $bProblemsExist = True
   $Code &= "Device Failure."
   $codemsg = "First restart the computer. If this does not resolve the issue, check for updated drivers. In some cases, this issue may also be resolved by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 27 Then
   $bProblemsExist = True
   $Code &= "Device failure - No Valid Log configuration"
   $codemsg = "This code means that the portion of the registry describing possible resources for a device does not contain valid entries. For example, the device is marked as configurable, but the configuration information in the .inf file is set to hardwired. To resolve this error code, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If the device still does not work, consult the hardware manufacturer for updated drivers or further assistance. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 28 Then
   $bProblemsExist = True
   $Code &= "Failed Installation - This device was not installed completely."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 29 Then
   $bProblemsExist = True
   $Code &= "Hardware Disabled - This device does not work and cannot be made to work."
   $codemsg = "Ensure that the device is not disabled through BIOS. Many times Windows cannot override settings in the BIOS. If the device is enabled there is no other known resolution."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 30 Then
   $bProblemsExist = True
   $Code &= "Cant Share IRQ."
   $codemsg = "A PCI/EISA SCSI controller is sharing an IRQ that is also in use by a real-mode device driver set not to be overwritten. Remove the real mode driver that is using the same IRQ as the device from the config.sys or autoexec.bat."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 31 Then
   $bProblemsExist = True
   $Code &= "<device> is not working properly."
   $codemsg = "The properties button displays the properties for the other device. More than likely the other device will also have one of these Device Manager error codes. Follow all the recommended solutions. If the devices still do not work remove the devices from Device Manager and use the Add New Hardware wizard in Control Panel to redetect them. Finally, verify that your devices have the latest drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 32 Then
   $bProblemsExist = True
   $Code &= "Cannot install the device because cannot access the Networked drive."
   $codemsg = "First, restart the computer. If this does not resolve your issue, verify that the device you are attempting to copy from is properly working. If the device is working, verify you have the latest drivers from the manufacturer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 33 Then
   $bProblemsExist = True
   $Code &= "Device is not responding."
   $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 34 Then
   $bProblemsExist = True
   $Code &= "The device requires manual configuration."
   $codemsg = "Set the jumpers for the device and configure the device manually through Device Manager. If this device has worked in the past and has stopped working uninstall any recently installed programs."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 35 Then
   $bProblemsExist = True
   $Code &= "BIOS does not contain necessary resource assignments."
   $codemsg = "Obtain the latest BIOS update."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 36 Then
   $bProblemsExist = True
   $Code &= "IRQ translation failed."
   $codemsg = "Adjust the IRQ reservation settings in CMOS (BIOS) setup."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 37 Then
   $bProblemsExist = True
   $Code &= "The DriverEntry routine failed when attempted by this driver."
   $codemsg = "Download and install the latest driver for the device with the error. If you're running the 64-bit version of Windows, make sure you're installing a 64-bit driver and not a 32-bit driver."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 38 Then
   $bProblemsExist = True
   $Code &= "The driver cannot load because a previous instance is still loaded."
   $codemsg = "Restart the computer. If after restarting the computer the issue persists, download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 40 Then
   $bProblemsExist = True
   $Code &= "Information in the registry entry for this driver is invalid."
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 41 Then
   $bProblemsExist = True
   $Code &= "A driver was loaded but Windows cannot find the device. "
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 42 Then
   $bProblemsExist = True
   $Code &= "Bus driver has created two devices with the same names."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 43 Then
   $bProblemsExist = True
   $Code &= "A device driver notified the operating system that the device failed."
   $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 44 Then
   $bProblemsExist = True
   $Code &= "The device driver was stopped by other software on the computer."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 45 Then
   $bProblemsExist = True
   $Code &= "The device is not present or was previously attached to the computer."
   $codemsg = "Re-attach the disconnected device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 46 Then
   $bProblemsExist = True
   $Code &= "The device is not available because the computer is shutting down."
   $codemsg = "The computer is in the process of shutting down. When computer restarts the device should function as normal."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 47 Then
   $bProblemsExist = True
   $Code &= "The device is ready for removal."
   $codemsg = "Unplug the hardware device and plug it back in or restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 48 Then
   $bProblemsExist = True
   $Code &= "Driver incompatibility."
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 49 Then
   $bProblemsExist = True
   $Code &= "The system hive has exceeded its maximum size and new devices cannot work until the size is reduced. "
   $codemsg = "Uninstall any un-used hardware devices."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 52 Then
   $bProblemsExist = True
   $Code &= "The driver may be unsigned or corrupted. "
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Else
   $codemsg = "Device Manager is Clean"
  EndIf
ExitLoop
Next
 
EndFunc

Share this post


Link to post
Share on other sites

Hi Storme

thanks for the input. I forgot we need to remove the words "exit loop" otherwise it doesnt work. but other than that cool. we can also use $DEVobjItem.DeviceID

would this come in handy for the device manager prog you were working on with llewxam or is that already done?

jamie


Drunken Frat-Boy Monkey Garbage

Share this post


Link to post
Share on other sites

Cool and useful script! :graduated:

perhaps needs tweaking...

I get this on my orbicam: (Have forcefully disabled a driver... (...or something. While ago...) don't want cam on...)

- "Cannot install the device because cannot access the Networked drive."

But my devicemanager says:

- "A driver (service) for this device has been disabled. An alternate driver may be providing this functionality. (Code 32)"

Osversion difference? something else?

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites

Cool and useful script! :graduated:

perhaps needs tweaking...

I get this on my orbicam: (Have forcefully disabled a driver... (...or something. While ago...) don't want cam on...)

- "Cannot install the device because cannot access the Networked drive."

But my devicemanager says:

- "A driver (service) for this device has been disabled. An alternate driver may be providing this functionality. (Code 32)"

Osversion difference? something else?

/Manko

Hi Manko

Ive just done a little more investigation and yep its my fault lol. These are the codes for win 95, 98 and 2000. I will update the code asap for the xp vista and 7 codes.

Sorry guys and gals

jamie


Drunken Frat-Boy Monkey Garbage

Share this post


Link to post
Share on other sites

I'm trying to get this working on an Embedded XP installation that my corporation uses.

However, the script errors out on the ObjGet command. Based on my research, it appears that this specific object name doesn't exist for these systems.

Anyone have any information on how I could get those?

$strComputer = "."
$DEVobjWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")

Share this post


Link to post
Share on other sites

good idea! only bad part of this is that if you have multiple errors then it doesn't give you that feedback, only the first instance

like I manually disabled a serial port, and I also ejected a usb drive and there are a error 22 and 47 but I only get the 22 back cause its the first thing it finds.

Share this post


Link to post
Share on other sites

good idea! only bad part of this is that if you have multiple errors then it doesn't give you that feedback, only the first instance

like I manually disabled a serial port, and I also ejected a usb drive and there are a error 22 and 47 but I only get the 22 back cause its the first thing it finds.

In the large For...In loop You have a number of If...Then...ElseIf

I imagine if you change the loop to For...Next and have them all to just If...Then...EndIf, and add @CRLF to string.

ie

if $DEVobjItem.ConfigManagerErrorcode = 1 Then

$bProblemsExist = True

$Code &= "System Failure - No Config" & @CRLF

$codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel" & @CRLF

Endif

That might help you


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Or just remove the ExitLoop call at the bottom, and put the MsgBox printing there. It'd pause on each error, and show it. As suggested further up, adding the name of the device to the output on each loop would be handy as well. I'm fixing it up for my purposes right now.

Share this post


Link to post
Share on other sites

Or just remove the ExitLoop call at the bottom, and put the MsgBox printing there. It'd pause on each error, and show it. As suggested further up, adding the name of the device to the output on each loop would be handy as well. I'm fixing it up for my purposes right now.

good call on that one!

I edited it a little bit and wrote to the console instead of msgbox for my personal purposes ...but this is what I got

#RequireAdmin
;==================================================================================
; function is used to determine if there are any issues in the device manager
;==================================================================================

    Dim $bProblemsExist, $bDisabledExist, $Code = "", $codemsg = ""
    $bProblemsExist = false
    $bDisabledExist = false
$strComputer = "."

DeviceProblems()

Func DeviceProblems()
$DEVobjWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")
$DEVcolItems = $DEVobjWMIService.ExecQuery("Select * from Win32_PnPEntity " & "WHERE ConfigManagerErrorCode <> 0")
For $DEVobjItem in $DEVcolItems
    $Code = $DEVobjItem.name & ": "
  if $DEVobjItem.ConfigManagerErrorcode = 1 Then
   $bProblemsExist = True
   $Code &= "System Failure - No Config"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel"
  Elseif $DEVobjItem.ConfigManagerErrorcode = 2 Then
   $bProblemsExist = True
   $Code &= "Device could not load driver"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 3 Then
   $bProblemsExist = True
   $Code &= "System Failure - Run Out of Memory"
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 4 Then
   $bProblemsExist = True
   $Code &= "Device Failure - Devloader/Static VxD/Configured is of Wrong Type."
   $codemsg = "This code indicates that the .inf file for this device may be incorrect or the registry may be damaged. This error code is displayed if the .inf file specifies a field that should be text, but is binary instead. In addition to following the recommended suggestions, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, please contact the hardware's manufacturer for an updated .inf file. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 5 Then
   $bProblemsExist = True
   $Code &= "Device Failure - Lacked an Arbitrator."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 6 Then
   $bProblemsExist = True
   $Code &= "Boot config Conflicted."
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 7 Then
   $bProblemsExist = True
   $Code &= "Filtering Failed - Possible problem in Device Driver Code."
   $codemsg = "If the device works correctly, you do need not to perform any steps to correct the code. If the device does not work correctly, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If you continue to receive this error code and the device does not function properly, check with the hardware manufacturer for an updated driver. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 8 Then
   $bProblemsExist = True
   $Code &= "System failure - Devloader Not Found"
   $codemsg = "If you are receiving an error about Devloader, there is no known resolution. If you are receiving any other error, reinstall the driver or update the driver. If you are getting an error with a System Devloader, Windows should be reinstalled because the Devloader is built into the Vmm32.vxd."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 9 Then
   $bProblemsExist = True
   $Code &= "Invalid Data in Registry."
   $codemsg = "This code means that the information in the registry for this device is invalid. It may be possible to resolve this error by using Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer for the proper registry settings or updated drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 10 Then
   $bProblemsExist = True
   $Code &= "Device Failed to start."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 11 Then
   $bProblemsExist = True
   $Code &= "Device Failure."
   $codemsg = "To resolve this error, run the Automatic Skip Driver utility from the System Information tool. If the problem persists, contact the hardware manufacturer for updated drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 12 Then
   $bProblemsExist = True
   $Code &= "Was normal conflicting - One of the resource arbitrators returned a failure. "
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 13 Then
   $bProblemsExist = True
   $Code &= "System Failure - Possible problem in Device Driver or Windows 95 Code. "
   $codemsg = "This code indicates that the device driver did not find the hardware. To resolve this error code, first ensure the device is properly installed. As an alternative, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 14 Then
   $bProblemsExist = True
   $Code &= "Need to restart your computer for this device to be re setup or to be finished installed."
   $codemsg = "Restart the computer"
  Elseif $DEVobjItem.ConfigManagerErrorcode = 15 Then
   $bProblemsExist = True
   $Code &= "This device is causing a resource conflict."
   $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 16 Then
   $bProblemsExist = True
   $Code &= "Was not fully detected, not all detected."
   $codemsg = "Double-click on the device, click the Resources tab and manually enter the settings. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 17 Then
   $bProblemsExist = True
   $Code &= "Device failure - Resource number was not found."
   $codemsg = "This code means that the hardware is a multiple-function device and the .inf file for the device is providing invalid information on how to split the device's resources to the child devices. To resolve this error code, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer about an updated .inf file. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 18 Then
   $bProblemsExist = True
   $Code &= "Reinstall."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 19 Then
   $bProblemsExist = True
   $Code &= "System Failure - Registry returned unknown result"
   $codemsg = "Problem in the registry. If you have Windows 95 and you have not made a backup of the registry you will need to reinstall Windows.If you have Windows 98: To resolve this issue, follow the recommended solution, which will run Scanreg.exe. If this does not resolve the issue, type scanreg /restore from C:\Windows\COMMAND. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 20 Then
   $bProblemsExist = True
   $Code &= "System Failure - VxDLdr Returned Unknown Result."
   $codemsg = "This code means VxD Loader (Vxdldr) returned an unknown result. For example, there could a version mismatch between the device driver and the operating system driver. Update the driver. If that does not work, try removing the device from Device Manager and then running the Add New Hardware Wizard in Control Panel. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 21 Then
   $bProblemsExist = True
   $Code &= "Will Be Removed."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 22 Then
   $bDisabledExist = True
   $Code &= "This device is disabled."
   $codemsg = "Double-click on the device and Enable. If this does not work, update the driver. If this also does not work, remove the device and reinstall through Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 23 Then
   $bProblemsExist = True
   $Code &= "Device Failure - Devloader was not ready."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 24 Then
   $bProblemsExist = True
   $Code &= "Device not Found, This device is either missing or not working properly."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 25 Then
   $bProblemsExist = True
   $Code &= "Was Moved - Possible problem in device driver code."
   $codemsg = "Attempt first to restart the computer at least two times, if you continue to get this error, Reinstall Windows."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 26 Then
   $bProblemsExist = True
   $Code &= "Device Failure."
   $codemsg = "First restart the computer. If this does not resolve the issue, check for updated drivers. In some cases, this issue may also be resolved by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 27 Then
   $bProblemsExist = True
   $Code &= "Device failure - No Valid Log configuration"
   $codemsg = "This code means that the portion of the registry describing possible resources for a device does not contain valid entries. For example, the device is marked as configurable, but the configuration information in the .inf file is set to hardwired. To resolve this error code, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If the device still does not work, consult the hardware manufacturer for updated drivers or further assistance. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 28 Then
   $bProblemsExist = True
   $Code &= "Failed Installation - This device was not installed completely."
   $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 29 Then
   $bProblemsExist = True
   $Code &= "Hardware Disabled - This device does not work and cannot be made to work."
   $codemsg = "Ensure that the device is not disabled through BIOS. Many times Windows cannot override settings in the BIOS. If the device is enabled there is no other known resolution."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 30 Then
   $bProblemsExist = True
   $Code &= "Cant Share IRQ."
   $codemsg = "A PCI/EISA SCSI controller is sharing an IRQ that is also in use by a real-mode device driver set not to be overwritten. Remove the real mode driver that is using the same IRQ as the device from the config.sys or autoexec.bat."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 31 Then
   $bProblemsExist = True
   $Code &= "<device> is not working properly."
   $codemsg = "The properties button displays the properties for the other device. More than likely the other device will also have one of these Device Manager error codes. Follow all the recommended solutions. If the devices still do not work remove the devices from Device Manager and use the Add New Hardware wizard in Control Panel to redetect them. Finally, verify that your devices have the latest drivers. "
  Elseif $DEVobjItem.ConfigManagerErrorcode = 32 Then
   $bProblemsExist = True
   $Code &= "Cannot install the device because cannot access the Networked drive."
   $codemsg = "First, restart the computer. If this does not resolve your issue, verify that the device you are attempting to copy from is properly working. If the device is working, verify you have the latest drivers from the manufacturer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 33 Then
   $bProblemsExist = True
   $Code &= "Device is not responding."
   $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 34 Then
   $bProblemsExist = True
   $Code &= "The device requires manual configuration."
   $codemsg = "Set the jumpers for the device and configure the device manually through Device Manager. If this device has worked in the past and has stopped working uninstall any recently installed programs."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 35 Then
   $bProblemsExist = True
   $Code &= "BIOS does not contain necessary resource assignments."
   $codemsg = "Obtain the latest BIOS update."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 36 Then
   $bProblemsExist = True
   $Code &= "IRQ translation failed."
   $codemsg = "Adjust the IRQ reservation settings in CMOS (BIOS) setup."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 37 Then
   $bProblemsExist = True
   $Code &= "The DriverEntry routine failed when attempted by this driver."
   $codemsg = "Download and install the latest driver for the device with the error. If you're running the 64-bit version of Windows, make sure you're installing a 64-bit driver and not a 32-bit driver."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 38 Then
   $bProblemsExist = True
   $Code &= "The driver cannot load because a previous instance is still loaded."
   $codemsg = "Restart the computer. If after restarting the computer the issue persists, download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 40 Then
   $bProblemsExist = True
   $Code &= "Information in the registry entry for this driver is invalid."
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 41 Then
   $bProblemsExist = True
   $Code &= "A driver was loaded but Windows cannot find the device. "
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 42 Then
   $bProblemsExist = True
   $Code &= "Bus driver has created two devices with the same names."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 43 Then
   $bProblemsExist = True
   $Code &= "A device driver notified the operating system that the device failed."
   $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 44 Then
   $bProblemsExist = True
   $Code &= "The device driver was stopped by other software on the computer."
   $codemsg = "Restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 45 Then
   $bProblemsExist = True
   $Code &= "The device is not present or was previously attached to the computer."
   $codemsg = "Re-attach the disconnected device."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 46 Then
   $bProblemsExist = True
   $Code &= "The device is not available because the computer is shutting down."
   $codemsg = "The computer is in the process of shutting down. When computer restarts the device should function as normal."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 47 Then
   $bProblemsExist = True
   $Code &= "The device is ready for removal."
   $codemsg = "Unplug the hardware device and plug it back in or restart the computer."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 48 Then
   $bProblemsExist = True
   $Code &= "Driver incompatibility."
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 49 Then
   $bProblemsExist = True
   $Code &= "The system hive has exceeded its maximum size and new devices cannot work until the size is reduced. "
   $codemsg = "Uninstall any un-used hardware devices."
  Elseif $DEVobjItem.ConfigManagerErrorcode = 52 Then
   $bProblemsExist = True
   $Code &= "The driver may be unsigned or corrupted. "
   $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers."
  Else
   $codemsg = "Device Manager is Clean"
  EndIf
ConsoleWrite("Device Manager Error Found!! " & @CRLF & $Code & " " & $codemsg & @CRLF & @CRLF)
;msgbox(4096,$Code,$codemsg)

Next

If $bDisabledExist = False And $bProblemsExist = False Then
$Code = "No Problems Found!!"
$codemsg = "Device Manager is Clean."
ConsoleWrite($Code & " " & $codemsg & @CRLF)
EndIf
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0