Error Message: Cannot Install Hardware. An Error Occurred During the Installation of the Device


After you upgrade your computer to Windows XP, and you try to install a device (such as a printer), you may receive the following error message:
Cannot install hardware.
An error occurred during the installation of the device.
The Data is invalid.


This issue may occur if the driver that is included with the device is incompatible with Windows XP.


Method 1: Install Windows service packs

To update Windows by installing the latest service packs, visit the following Web site, and then select the version of Windows that you are using:
After you install any available service packs, again try to install the device.

Method 2: Replace the file with the original version of the file from the Windows installation disk, and then remove and reinstall your hardware device

To resolve this issue, follow these steps:
  1. Restart the computer in Safe Mode.
  2. Rename the file that is in the following folder:
    C:\Windows\Driver cache\i386
    For example, rename the file as
  3. Insert the Windows XP CD-ROM into the CD-ROM or DVD-ROM drive.
  4. When the Welcome screen appears, click
    Perform additional tasks.
  5. Click Browse this CD, and then double-click the I386 folder.
  6. Click the file, and then on the
    Edit menu, click Copy.
  7. In Windows Explorer, open the following folder:
    C:\Windows\Driver cache\I386
  8. On the Edit menu, click
    Paste to paste the file in the C:\Windows\Driver cache\I386 folder.
  9. Remove the device that you tried to install.

    For example, if you received the error when you tried to install a printer, follow these steps to remove the printer:
    1. Click Start, click Control Panel, and then click Printers and Other Hardware.
    2. Click Printers and Faxes (or the icon representing the type of device that you want to remove).
    3. Right-click the printer that you want to remove, click
      Delete, and then click Yes to confirm deletion of that printer.

    Use Device Manager to remove the device. For example, if you received the error when you tried to install a modem, follow these steps to remove the modem:
    1. Click Start, right-click My Computer, click Manage, and then click Device Manager.
    2. Expand Modems, select your modem, and then press DELETE. Click Yes to confirm.
  10. Restart the computer. Your new device should be detected and automatically installed.
You may also want to contact the device manufacturer to obtain the most recent drivers for your device.
For information about how to contact your device manufacturer, visit the following Microsoft Web site: