Windows Plug and Play device detection usually works pretty well. Read the instructions on your new peripheral to see whether to pop in the disk before or after plugging in the new device - long as you get it right, Windows will probably install the device. However, some things can go wrong. I'm not going to talk about easy cases, or bad hardware, or anything you'll find the answer to easily.
What do you you do when Windows won't install anything - everything shows up as an "Unknown Device", even things that were working before you started messing around? What do you do indeed? I'll tell you.
Information about the drivers needed to run a specific device is contained in an INF file - that is, a special text file with the extension .INF. When you install the driver for your device, one of the things that happens is that Windows puts a copy of the .INF into the %SystemRoot%\INF directory. For those of you too young to remember this stuff from batch programming in DOS, SystemRoot is an "environment variable", which holds some information about the system so programs can use that information later. In this case, SystemRoot holds the location of your Windows directory - usually that's "C:\windows", but not necessarily. You might have installed on a different drive, or called the directory WinNT (very common), or WinDoze, or Ventanas, or Fenstern - doesn't matter, programs still need to be able to find it. Putting percent signs around it means "don't use the word SystemRoot, use whatever SystemRoot is set to." So on my machine, %SystemRoot%\inf is interpreted as C:\Windows\inf. So far, so good.
Now, you might have called your INF directory something else (not very likely, but hey), or - more likely - the manufacturer of your machine (I'm thinking Dell here) might have pre-loaded drivers for all the factory-installed stuff in your machine before they installed Windows. In that case, Windows needs to know where, besides the C:\windows\inf directory, to look for INF files. So - like so many other things - Windows stores this information in the Registry. Specifically, in a location called "DevicePath". And again, so far so good.
However! it turns out that, under certain circumstances, device manufacturers (I'm talking to you, Linksys!) try to add extra locations to the DevicePath. And sometimes, as a result, Windows forgets how to interpret "%SystemRoot%\inf", and as a result Windows can't find drivers for anything. And Plug'n'Play fails, and you curse your luck. But have no fear! If Google has brought you this far, I can help you out!
Standard disclaimer: this involves editing the Windows system
Registry. If you're not careful, messing around inside the Registry
can screw up Windows so thoroughly that you'll need a lifetime of
psychoanalysis - or at least a format and reinstallation - to get over
the damage. So be careful, BACK IT UP FIRST, and sacrifice to whatever
deity you favor before proceeding. If step 1 below - "Fire up your
favorite Registry editor" - confuses you, you do not have enough
experience to adventure here. Continue at your own risk.)
- Fire up your favorite Registry editor - I happen to like Registrar Lite, from Resplendence , but RegEdit is already installed on every Windows machine.
- Navigate to the following key: My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version
- Find the following value entry: DevicePath
- On most machines it will look something like this: %SystemRoot%\Driver Cache;%SystemRoot%\inf (or $SystemRoot%\inf may be the only thing there); on your machine there may be other directories listed, like C:\DRIVERS;C:\dell\drivers.
- The problem that I found - which may not be the same as yours - is that, when "real" directories such as "C:\dell\drivers" are mixed with "virtual" directories such as "%SystemRoot%\inf", Windows forgets how to expand the virtual ones. So you need to do it yourself.
- Determine where the current version of Windows is installed - if you're one of those people who runs multiple versions of Windows just to show it can be done, be very sure you've got the right one. And for Pete's sake: spelling counts!
- Replace each instance of %SystemRoot% with the actual Windows directory - for instance, on my machine, %SystemRoot%\inf becomes C:\Windows\inf and %SystemRoot%\Driver Cache becomes C:\Windows\Driver Cache
- Upper/lowercase does not matter - c:\windows works just as well as C:\WINDOWS.
- Spaces DO matter. Spelling DOES matter.
- Don't do this to any entry EXCEPT DevicePath!
- Exit from the Registry editor.
- Using Start/Search/For Files and Folders..., find every copy of INFCACHE.1 on your system (make sure that hidden and system files are being displayed - look it up if you don't know what that means) and delete them. Don't delete any .INF files.
- Restart your machine.
- As soon as it boots up again, Plug and Play should be working again.
- If necessary, run the Device Mangler (Start/Run, type "devmgmt.msc", click OK) and make sure there are no more "Unknown Device"s left. If there are, delete them and click "Scan for hardware changes" - this time, Plug and Play should install them properly. Make sure you have the installation disks available for everything that wasn't working before.
- If this didn't fix your problem, then most likely your problem was one of the device-specific cases I mentioned at the top. This fix is only indicated when Windows tells you it can't find a working driver for anything.
- The change that we made may cause problems down the road if you decide to move Windows to a different location. If you do that, you'll have plenty of other things to worry about.
|