How to remove a driver permanently

Sat, 2007-11-03 07:38 by admin

General

Sometimes you get into a situation where you want to remove or replace a driver, but Windows remembers the driver and keeps reinstalling it.

If this happens, you have to erase that part of Windows' memory. You need to delete the relevant .inf file from %windir%\inf. It will be called oemX.inf. There will also be an oemX.pnf.

In the following example we will use a Netgear driver named WG311T. Of course you have to substitute the name of your problem driver when applying this solution.

You will first have to identify the inf file that contains the information about the problem driver, then delete that file.

Windows Vista

In device manager, double-click your problematic device (WG311T).

Go to the Details tab. Where it says "Property:" (combobox), change from "Device Description" to "Inf name". This tells you which .inf file is used for installing the driver.

Go to cmd prompt again, and to: %windir%\inf

Delete that file and its corresponding .pnf file. Job done.

If you have UAC (User Access Control) enabled, you will probably need to 'Run as Administrator' your Command Prompt.

Windows XP

Enter the following commands:

cmd
cd %windir%\inf
for %a in (oem*.inf) do find /i "WG311T" %a >>out.txt
notepad out.txt

Where I have put "WG311T" above in the for %a line, you need to make sure it's written just like the device name is in device manager. Capitals don't
matter (because of the /i (ignore case), but if it's "WG-311-T" then you need to write it like that, with the dashes.

This will open up a notepad windows showing you the results of a text search through oem*.inf. Look through out.txt to see which of those oemX.inf files
is the netgear one. The stuff might not mean much to you, but it'll point at which of those inf files describes your Netgear card. You get a header (filename) like --------OEM6.INF and following that will be the matching text, so you will be looking for the filename (------OEMX.INF) just above any netgear stuff that is shown.

Remember the inf file name. In this example we will assume it is: oem12.inf

Type:

attrib -h -r -s oem12.*
del oem12.*

What you are doing here is deleting the file that we found was the right one, and also its .PNF counterpart. On XP, .pnf files always seem to be read-only, so we have to use attrib to remove that read-only attribute. On my new Vista machine it looks like the .pnf files are not read-only, but some of the .inf files are, which I have never come across pre-Vista, so the above commands are going to remove read-only & system & hidden attributes on both .inf & .pnf just to be sure.

After doing the above, uninstall the item from device manager and it should no longer find the already installed driver.

[This blog entry has originally been authored by somebody who has not visited this web site for more than two years.]