How to Fix: Keyboard Won't Work: Corrupt, Missing Drivers (Code 39) - This Works!

Dennis Faas's picture

Infopackets Reader Alan B. writes:

" Dear Dennis,

I rebooted my laptop recently, and now my keyboard has completely stopped working. I looked at the status of my keyboard under Device Manager and it reports that my keyboard is a 'Standard PS/2 Keyboard' with an error code 39. The specific error message is: 'Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)'. I have scoured the Internet and have tried various registry 'fixes' online, but nothing works! You fixed my computer a few years back using your remote desktop support service, and I'd like to hire you again to fix this keyboard error code 39 issue. The only way I can type right now is using the on-screen keyboard, which is very inconvenient. Please help! "

My response:

I have not had this problem before but was willing to connect with Alan using my remote desktop support service to have a closer look. Sure enough, his laptop keyboard was listed as a "PS/2 keyboard" with error code 39. Initially I thought this might have been a mistake, because PS/2 keyboards are usually external keyboards - however, it's possible the laptop keyboard and PS/2 keyboards use the same driver.

Below I'll describe what I did in order to resolve the issue, then I'll list the details in step-by-step order so you can do the same.

Troubleshooting: Keyboard Not Working: Driver Corrupt or Missing (Code 39) Error

The first thing I did was go into Device Manager and delete the current keyboard driver, then had Device Manager re-detect the hardware. 9 times out of 10 this will fix a driver issue, especially where the driver isn't loading properly, for whichever reason. Unfortunately, this did not work.

The next thing I tried was to 'update' the existing driver. Oftentimes if the driver is incorrect or out of date, updating it to the next version (if one is available) will fix the issue. Unfortunately, this didn't work either, as Windows reported that Alan had the latest driver installed.

After that I did a bit of research and tried some registry fixes, including one that was downloadable and labeled as "kb_code39_fix.reg" that fixed "upper filters". Unfortunately, that registry fix did not work either - in fact, it wouldn't even load into Alan's registry. At this point I researched the issue a bit more and came across a Youtube video explaining a different approach utilizing the i8042prt registry key. This video (though rather shaky) explained how to modify a keyboard registry value that forces the keyboard to re-detect itself. I did just that, then rebooted - and the problem was solved.

Below I'll explain using step-by-step instructions.

How to Fix: Keyboard Won't Work: Corrupt, Missing Drivers (Code 39)

  1. First, bookmark this page now so that you can come back to it, as more than one of the steps below requires restarting your machine to apply a fix. Next you'll need to open the on-screen keyboard so that you can "type" in some commands below, which will be necessary.
  2. To begin, let's review the keyboard status under Device Manager. To do so: click Start, then using the on screen keyboard, type in "This PC" (For Windows 8 and 10 users) or "My Computer" (for Windows Vista and 7 users); wait for "This PC" or "My Computer" to appear in the list, then right click it and select "Properties". The "System" window will now appear; in the top left corner, click on the "Device Manager" link.

    The Device Manager window will now appear; scroll down the list until you see "Keyboards" listed, then expand the list. Under the "Keyboards" heading you should see "Standard PS/2 Keyboard" (or something similar), and its icon will likely have an exclamation point next to it, indicating an error. If you double left-click on the "Standard PS/2 Keyboard", it will bring up a window with the title "Standard PS/2 Keyboard Properties" (or similar). Under the "General" tab it will say if there is a problem with the keyboard. For a normally functioning keyboard, it will report "This device is working properly"; however, if you have the error code 39 message, it will say: Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)'. Close the "Standard PS/2 Keyboard Properties" window and continue on to the next step.
  3. Next, we'll try and delete the keyboard device and re-detect it in Device Manager. As I mentioned previously, this almost always fixes a driver issue where a device was working properly before, but isn't now (for whatever reason that may be - including Error Code 39). To do so: go to Device Manager once again and ensure that the "Keyboards" list is expanded to reveal your keyboard (it may be listed as "Standard PS/2 Keyboard" or similar). Left click the "Standard PS/2 Keyboard" (or similar) to highlight it, then press DEL on your keyboard to delete it. Windows will warn you that "You are about to remove the device from the system" - click OK to continue. If it asks whether you want to remove the driver, click Yes.

    Once that is done, go to the very top the Device Manager window and click Action -> Scan for hardware changes. At this point your keyboard should re-detect itself and hopefully the error code 39 will go away. You can test your keyboard by opening up Notepad and typing in some characters. If it does not work, proceed to the next step.
  4. The next thing to do is to try and update the keyboard driver using Device Manager. To do so, return to the Device Manager window, then right click your keyboard (via Keyboards -> Standard PS/2 Keyboard, for example) and select the "Update Driver Software..." option. A new window will appear and ask "How do you want to search for driver software?" Choose the option "Search automatically for updated driver software". Windows will go online and search for an update to your keyboard - if one is available - and apply the update to your keyboard; you may need to reboot to complete the change. If Windows reports that "The best driver software for your device is already installed", then proceed to the next step.
  5. The next step is what fixed it for Alan. I've gone ahead and made these instructions as easy as possible using a command prompt, so you don't have to use the registry editor. To execute the command, you'll need to open up an administrative command prompt. To do so: click Start, type in "cmd" (no quotes); wait for "CMD.EXE" or "Command Prompt" to appear in the list, then right click it and select "Run as Administrator". Next, use your mouse to highlight the text below:

    rem value was previous set to 3
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt" /v Start /t REG_DWORD /d 1 /f
    echo this is a dummy line
  6. Right click over top of the above highlighted text, then select "Copy" from the dialogue menu. Next, right click in the middle of the command prompt window and select "Paste" from the dialogue menu. The text you copied in Step #5 above should output to the command line.
  7. Bookmark this page if you have not done so already, then reboot the computer as this will force your keyboard to de-detect itself. Once the computer has rebooted and you're back at the desktop, your keyboard should now be working - use Notepad or such to test it out. If it's working, pat yourself on the back for a job well done! If it is not, you are welcome to contact me for additional support, described next.

Additional 1-on-1 Support: From Dennis

If the above instructions are over your head, or if you need help resolving the "Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)" error, I can help using my remote desktop support service. Simply contact me briefly describing your issue and I'll get back to you as soon as possible.

Got a Computer Question or Problem? Ask Dennis!

I need more computer questions. If you have a computer question -- or even a computer problem that needs fixing - please email me with your question so that I can write more articles like this one. I can't promise I'll respond to all the messages I receive (depending on the volume), but I'll do my best.

About the author: Dennis Faas is the owner and operator of With over 30 years of computing experience, Dennis' areas of expertise are a broad range and include PC hardware, Microsoft Windows, Linux, network administration, and virtualization. Dennis holds a Bachelors degree in Computer Science (1999) and has authored 6 books on the topics of MS Windows and PC Security. If you like the advice you received on this page, please up-vote / Like this page and share it with friends. For technical support inquiries, Dennis can be reached via Live chat online this site using the Zopim Chat service (currently located at the bottom left of the screen); optionally, you can contact Dennis through the website contact form.

Rate this article: 
Average: 3.9 (16 votes)