Keyboard and mouse not working in Windows

Introduction

So my keyboard and mouse suddenly stopped working, and I really didn’t know why. What followed was many frustrating hours spent to try and “safe” my machine from a new fresh Windows 7 install, because it would take just too much time to do a fresh install of everything that I currently have on the laptop.

However, the keyboard did work while I was trying to access the BIOS, but as soon as Windows started loading the keyboard and touchpad stopped working. The system booted to the Windows logon screen and I wasn’t able to do anything. Or at least, then I decided to confront the problem. ūüôā

Note: First create a backup of your registry or create a System Restore point before you proceed!

The symptoms

Further symptoms manifested themselves by showing that there were some driver problems in the Device Manager. The following devices seemed to have problems:

  • HID Keyboard Device
  • Standard PS/2 Keyboard
  • PS/2 Compatible Mouse

The error codes varied and so it is really dependent of your system configuration, but is should be at least one of the following:

  • This device cannot start. (Code 10)
  • This device is not working properly because Windows cannot load the drivers required for this device. (Code 31)
  • Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)
  • Windows cannot access this hardware because its service key information in the registry is missing or recorded incorrectly. (Code 40)

Fix it automatically in Windows Vista/7

You can fix the problem automatically by downloading and running the following registry file:

DOWNLOAD REGISTRY FIX

Now just restart Windows and the problem should be solved.

If the problem is still present and/or you want to fix it manually, then follow the instructions in the section Fix it manually.

Fix it manually

You should access the registry by clicking on Run and then typing

regedit

Now find the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}

You should now see a key UpperFilters which should contain at least one entry “kbdclass”. If you have the same problem as I do, then you there are more entries there which you should delete. So now after editing, your UpperFilters key should only contain “kbdclass” (without quotes). Restart Windows, and the problem should be fixed. ūüôā

If you only have the entry “kbdclass” as value and/or are still experiencing the same problem, then you should search for the word “kbdclass” (without quotes) and replace every UpperFilters key with kbdclass and other values to only kbdclass.

 


Below you’ll find further information and alternative scenarios on how to fix certain sub-problems.

Problems with logging into Windows

To fix the problem you should be able to access the Registry in some way and change the registry keys. I managed to get into windows by using a separate USB-mouse and accessing the On-Screen Keyboard by which I could login and do the necessary registry changes. You can do this by

  1. Clicking on the Ease of Access button at the bottom-left corner of the login screen
  2. Checking the “Type without the keyboard” and clicking OK
  3. Clicking on: Ctrl+AltGr+Del
  4. Logging in

Fixing other similar problems

The problem in my situation was that there was also a keyboard driver installed from VMware. The¬†VMware Keyboard Driver¬†had an additional entry “vmkbd” in the UpperFilters key, but as I discovered the driver file that was needed (C:\Windows\system32\drivers\VMkbd.sys) was missing which in effect caused all the problems.

The folder with GUID

{4D36E96B-E325-11CE-BFC1-08002BE10318}

represents the class Keyboard that is defined by the Windows operating system. It is used to install devices or other drivers. If you have another but similar problem, then you could try to analyze the filters under the GUIDs as listed below (see [3] for a complete list).

Class GUID Device Description
CDROM 4D36E965-E325-11CE-BFC1-08002BE10318 CD/DVD/Blu-ray drives
DiskDrive 4D36E967-E325-11CE-BFC1-08002BE10318 Hard drives
Display 4D36E968-E325-11CE-BFC1-08002BE10318 Video adapters
FDC 4D36E969-E325-11CE-BFC1-08002BE10318 Floppy controllers
FloppyDisk 4D36E980-E325-11CE-BFC1-08002BE10318 Floppy drives
HDC 4D36E96A-E325-11CE-BFC1-08002BE10318 Hard drive controllers
HIDClass 745A17A0-74D3-11D0-B6FE-00A0C90F57DA Some USB devices
1394 6BDD1FC1-810F-11D0-BEC7-08002BE2092F IEEE 1394 host controller
Image 6BDD1FC6-810F-11D0-BEC7-08002BE2092F Cameras and scanners
Keyboard 4D36E96B-E325-11CE-BFC1-08002BE10318 Keyboards
Modem 4D36E96D-E325-11CE-BFC1-08002BE10318 Modems
Mouse 4D36E96F-E325-11CE-BFC1-08002BE10318 Mice and pointing devices
Media 4D36E96C-E325-11CE-BFC1-08002BE10318 Audio and video devices
Net 4D36E972-E325-11CE-BFC1-08002BE10318 Network adapters
Ports 4D36E978-E325-11CE-BFC1-08002BE10318 Serial and parallel ports
SCSIAdapter 4D36E97B-E325-11CE-BFC1-08002BE10318 SCSI and RAID controllers
System 4D36E97D-E325-11CE-BFC1-08002BE10318 System buses, bridges, etc.
USB 36FC9E60-C465-11CF-8056-444553540000 USB host controllers and hubs

The next step is to adjust the UpperFilters like the problem where the CD or DVD drive is missing or not recognized by other programs [1][2].

References

“Python Version 2.7 required which was not found in the registry”


Introduction
Any module installer that is created using distutils (bdist_wininst) is very likely to produce this error. The problem is that it only detects 32bit installations of Python on 64bit Windows machines. Or more technically, 32bit versions of Python create the following registry path

HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\PythonCore

while 64bits versions create a slightly other registry path which is

HKEY_CURRENT_USER\Software\Python\PythonCore

When any 32-bit module setup is started (with a Python 64-bit on your system), it first checks whether the first path exists, while instead it should check the second (which does exist).

There are basically three ways of solving this:

  • You can install a 32-bit Python version
  • or install a 64-bit version of your module
  • or adjust the registry such that it really sees that a 64bit Python is installed

I will of course elaborate on the last two options.

Install a 64-bit version of your module

You can find many module binaries here. Choose a 64-bit version and install it. This is the most clean way of fixing the problem.

If your module is not in the list, then try the alternative below.

Fix by adjusting the registry

So the dirty way is to do the following adjustments in the registry:

  1. Run regedit.
  2. Locate the path: HKEY_CURRENT_USER\Software\Wow6432Node\
  3. Create keys in this path: Python\PythonCore\2.7\InstallPath
  4. Modify the “(Default)“, which is initially empty, to the path where Python is located, for example “C:\Python27\”.
  5. You are done. Exit and retry the setup that gave the error.

You can alternatively create a .reg file (for example fix.reg) that will do the above steps automatically. Put exactly the following in it:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath]
@="C:\\Python27\\"

If you are lazy, then you can also download this file, unpack the registry file and just run it.

 

“Unable to find vcvarsall.bat” error when trying to install lxml

I needed the lxml library on a machine for some python script that I coded earlier. I tried using easy_install by doing

easy_install lxml

but then I got the following error:

Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.3
Downloading http://lxml.de/files/lxml-2.3.3.tgz
Processing lxml-2.3.3.tgz
Running lxml-2.3.3\setup.py -q bdist_egg --dist-dir c:\users\edin\appdata\local\
temp\easy_install-9sxhlm\lxml-2.3.3\egg-dist-tmp-pjbtkm
Building lxml version 2.3.3.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
warning: no files found matching 'lxml.etree.c' under directory 'src\lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src\lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxml'
warning: no files found matching 'etree_defs.h' under directory 'src\lxml'
warning: no files found matching 'pubkey.asc' under directory 'doc'
warning: no files found matching 'tagpython*.png' under directory 'doc'
warning: no files found matching 'Makefile' under directory 'doc'
error: Setup script exited with error: Unable to find vcvarsall.bat

I tried installing libxml2 and libxslt, but it resulted in similar errors.

Searching for libxml2
Reading http://pypi.python.org/simple/libxml2/
Couldn’t find index page for ‘libxml2’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for libxml2
Best match: None
Traceback (most recent call last):
File “C:\Python27\Scripts\easy_install-script.py”, line 8, in
load_entry_point(‘setuptools==0.6c11’, ‘console_scripts’, ‘easy_install’)()
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1712, in main
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1700, in with_ei_usage
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1716, in
File “C:\Python27\lib\distutils\core.py”, line 152, in setup
dist.run_commands()
File “C:\Python27\lib\distutils\dist.py”, line 953, in run_commands
self.run_command(cmd)
File “C:\Python27\lib\distutils\dist.py”, line 972, in run_command
cmd_obj.run()
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 211, in run
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 434, in easy_install
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\pac
kage_index.py”, line 475, in fetch_distribution
AttributeError: ‘NoneType’ object has no attribute ‘clone’

In one of my previous posts I pointed out how you can solve a similar problem with a missing vcvarsall.bat error, but unfortunately that approach did not solve my problem. Compiling the sources from the ground up was a too intensive job (which I might try to figure out in the future), so I chose the easy path.

The issue was solved by installing these packages from this site which lists a lot of (unoffical) Windows binaries for Python. Everything suddenly started to work as it should. ūüôā

How to send large files using ¬ĶTorrent

Introduction

There are numerous ways to share your files. This includes the usual mail, Windows Live Messenger, file-hosting sites like RapidShare, Dropbox, FTP and many other ways.

However, all have the following problem. Lets say that you want to share some REALLY big amount of data with someone, like for example 5GB or maybe even 20GB. In that case all of the above mentioned ways of sharing have serious drawbacks.

Windows Live Messenger is often very slow, can share only a few files at a time and does not support resume on sending files (which basically means that if for example your connections dies out while having 99% of your file already sent, you have to send the file all over again!). File-hosting sites like RapidShare, MegaUpload and similar sites have file size limits so that you need to upload big files by splitting it in different parts that are withing this limit  and so on (which is also the case if you use Dropbox). FTP does not pose a limit on the number or size of the files, but it again does not offer a resume of a download like Windows Live Messenger. Other drawbacks of all these type of methods  is the requirement of some initial setup, technical knowledge, user registration on websites, ads, etc.

Continue reading How to send large files using ¬ĶTorrent

Cannot Install Microsoft .NET Framework 3.5 SP1

There might be several reasons as to why you can’t install the .NET Framework. I had the problem while installing the framework via the Windows Update.

Symptoms
While trying to install¬†Microsoft .NET Framework 3.5 SP1 Update for Windows 7 x86 (KB982526),¬†Windows Update told me that the update was unsuccessful and gave me the following “useful” error:

“WindowsUpdate_800F081F” “WindowsUpdate_dt000”

You might also get several other errors similar to the following:

  • an error of type 0x643
  • Microsoft .NET Framework 3.5 (x64) ‘package’: [2] Error: Installation failed for component Microsoft .NET Framework 3.5 (x64) ‘package’. MSI returned error code 1601
  • Microsoft .NET Framework 3.5 (x64) ‘package’: [2] Error: Installation failed for component Microsoft .NET Framework 3.5 (x64) ‘package’. MSI returned error code 1603
  • Microsoft .NET Framework 3.0SP1 (x64) (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 3.0SP1 (x64) (CBS). MSI returned error code -2146762496
  • WapUI: [2] DepCheck indicates Microsoft .NET Framework 2.0SP1 (CBS) is not installed
Regarding the installation via Windows Update, you might furthermore experience problems with installing Windows Internet Explorer 9 for Windows 7 by getting an error similar to this:

“WindowsUpdate_00009C47” “WindowsUpdate_dt000”

Solution(s)
It strongly depends on the situation and your system but you might try one of the following solutions:

  • You can first try to install the¬†System Update Readiness Tool for Windows 7 which is an August 2011¬†release (KB947821¬†– 32-bit (x86)) at this moment of writing. This should solve any inconsistencies in the Windows servicing store¬†which may prevent the successful installation of future updates, service packs, and software. There is also a 64-bit version for Windows 7. Windows Vista: 32-bit¬†(x86), 64-bit (x64).
  • If you’re not using Windows Update, then you can try to download and install the framework manually:¬†Microsoft .NET Framework 3.5 Service Pack 1.
  • There is also a newer version of the framework which most newer applications use which might also suffice:¬†Microsoft .NET Framework 4 (Web Installer).
  • Another thing that you can try on top of all the above is to first remove all the existing .NET framework versions. Do it via Add or remove programs from the Configuration Panel. You can also try the¬†.NET Framework Cleanup Tool.
  • Do the following: Start > Run > type “services.msc”. Now check whether the Startup Type¬†of¬†Windows Installer is set to Manual.
  • Go to¬†Start > Control Panel > Programs > Turn Windows features on or off.¬†Check now that the Microsoft .NET Framework 3.5.1 is checked on.
  • Disable any security/antivirus software while trying to install. Usually this shouldn’t give problems, but it’s worth a try.
If you still didn’t fix your problem, you can start a discussion in the comments below. If you fixed it in another way, then please share it and I’ll add it to the list above.

How to manually add a package to MiKTex

The fact that I’m writing this article implies that it is far from a trivial task to do this. After about 2 hours I finally found a solution that just works. Note that I’m using MiKTeX 2.9 on Windows 7, so the solution may not be working for other versions of MiKTeX and the path to the directory may vary depending on your version of windows and/or your installation preferences. The concept however is the same.

To make this work you should complete the following steps:

  1. Download the package file that you want to install.
  2. Create a directory in (make sure that you have admin privileges in case of Vista/7):
    • C:\Program Files\MiKTeX 2.9\tex\latex\base (for Windows XP/Vista/7 on a 32-bit Windows version)
    • C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base (for Vista/7 on a 64-bit Windows version)
  3. Go to Start > MiKTeX > Maintenance (Admin) > Settings (Admin) and click on Refresh FNDB.
  4. Restart your LaTeX editor (in my case it was WinEdt 6.0) and now you should be able to use your new package.

 

Note that in step 3 I have deliberately wrote that you should chose the Admin folder, which is important if you are running Windows Vista or Windows 7, since otherwise refreshing FNDB will not result in your package being added to the database! Alternatively, you can also open the settings from the non-Admin or in some other way, but in any case make sure that the process has admin rights to update the database. If you have a more complex setup you can read this post that gives some more advanced information on how to manually add packages.

“LaTeX source files more than 5 years old!”

Got this compile error from LaTeX today and I really don’t have any idea what is exactly going on.

This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8)
Running miktex-pdftex.exe...
This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8) (INITEX)
entering extended mode
("C:\Program Files\MiKTeX 2.8\tex\latex\config\latex.ini"
(C:\Users\Edin\AppData\Roaming\MiKTeX\2.8\tex\generic\config\pdftexconfig.tex)
("C:\Program Files\MiKTeX 2.8\tex\latex\base\latex.ltx"
("C:\Program Files\MiKTeX 2.8\tex\latex\00miktex\texsys.cfg")
./texsys.aux found

\@currdir set to: ./.

Assuming \openin and \input
have the same search path.

Defining UNIX/DOS style filename parser.

catcodes, registers, compatibility for TeX 2,  parameters,

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! You are attempting to make a LaTeX format from a source file
! That is more than five years old.
!
! If you enter <return> to scroll past this message then the format
! will be built, but please consider obtaining newer source files
! before continuing to build LaTeX.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! LaTeX source files more than 5 years old!.
l.545 ...aTeX source files more than 5 years old!}

No pages of output.
Transcript written on latex.log.
miktex-makefmt: miktex-pdftex.exe failed on latex.ini.
initexmf.exe: The operation failed for some reason.
initexmf.exe: Data: C:\Program Files\MiKTeX 2.8\miktex\bin\miktex-makefmt.exe
I can't find the default format file!

However, I did find a workaround that seemed to solve the problem and I decided to share it. Perform the following steps:

  1. Open “C:\Program Files\MiKTeX 2.8\tex\latex\base\latex.ltx” (or wherever your latex.ltx resides). One alternative path that is different from mine is “C:\Program Files\MiKTeX\miktex\bin\tex\latex\base”.
  2. Find “\ifnum\count@65>” and change it into “\ifnum\count@>100” (or some number larger than 100)
  3. Save the file.

The real problem is not fixed, but at least you should now be able to compile your files.

Note that in Windows Vista and Windows 7 you’ll have to have administrator access to be able to overwrite this file since Program Files is a system directory. One way to accomplish this is to simply copy the file to let’s say the desktop, edit it, and then overwrite the original file with the edited file.

1=2

[latexpage]

Assume that $a=1$ and $b=1$. Then we trivially have

    $a=b$

Multiply both sides with $a$

    $a^2=ab$

Substract $b^2$ from each side

    $a^2-b^2=ab-b^2$

Rewrite by factorizing

    $(a+b)(a-b)=b(a-b)$

Cancelling $(a-b)$ from both sides gives

    $a+b=b$

Since $a=1$ and $b=1$ we get

    $2=1$.

Q.E.D. ?