需要在 Windows 7 中完全删除设备驱动程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19886995/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Need to completely remove a device driver in windows 7
提问by B4wii
I have an old USB device that is not recognized by windows 7, so I grabbed the device driver for the chip that handles the USB communications. After I modified it I used it to install for the device. Stupid I know, but now I need to get rid of it.
我有一个 Windows 7 无法识别的旧 USB 设备,因此我获取了处理 USB 通信的芯片的设备驱动程序。在我修改它之后,我用它来安装设备。愚蠢的我知道,但现在我需要摆脱它。
Below is the code from the inf setup file. This does not have the VID and PID that I changed. I need to reverse all the changes it made.
下面是 inf 安装文件中的代码。这没有我更改的 VID 和 PID。我需要撤销它所做的所有更改。
; Installation INF for the Cypress Generic USB Driver for Windows Vista
; Processor support for OS unknown platforms.
;
; (c) Copyright 2010 Cypress Semiconductor Corporation
;
[Version]
Signature="$WINDOWS NT$"
Class=USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
provider=%CYUSB_Provider%
CatalogFile=CYUSB.cat
DriverVer=10/12/2010,3.4.4.000
[SourceDisksNames]
1=%CYUSB_Install%,,,
[SourceDisksFiles]
CYUSB.sys = 1
[DestinationDirs]
CYUSB.Files.Ext = 10,System32\Drivers
[ControlFlags]
ExcludeFromSelect = *
[Manufacturer]
%CYUSB_Provider%=Device,NT,NTx86,NTamd64
;for all platforms
[Device]
;%VID_XXXX&PID_XXXX.DeviceDesc%=CyUsb, USB\VID_XXXX&PID_XXXX
;for windows 2000 non intel platforms
[Device.NT]
; Cypress FX2LP default ID
%VID_04B4&PID_8613.DeviceDesc%=CyUsb, USB\VID_04B4&PID_8613
; Cypress FX1 default ID
%VID_04B4&PID_6473.DeviceDesc%=CyUsb, USB\VID_04B4&PID_6473
; Cypress Streamer Device. CyStream firmware examples use this VID/PID
%VID_04B4&PID_1003.DeviceDesc%=CyUsb, USB\VID_04B4&PID_1003
; Cypress FX2LP Example Device. DVK firmware examples use this VID/PID
%VID_04B4&PID_1004.DeviceDesc%=CyUsb, USB\VID_04B4&PID_1004
;for x86 platforms
[Device.NTx86]
; Cypress FX2LP default ID
%VID_04B4&PID_8613.DeviceDesc%=CyUsb, USB\VID_04B4&PID_8613
; Cypress FX1 default ID
%VID_04B4&PID_6473.DeviceDesc%=CyUsb, USB\VID_04B4&PID_6473
; Cypress Streamer Device. CyStream firmware examples use this VID/PID
%VID_04B4&PID_1003.DeviceDesc%=CyUsb, USB\VID_04B4&PID_1003
; Cypress FX2LP Example Device. DVK firmware examples use this VID/PID
%VID_04B4&PID_1004.DeviceDesc%=CyUsb, USB\VID_04B4&PID_1004
;for x64 platforms
[Device.NTamd64]
; Cypress FX2LP default ID
%VID_04B4&PID_8613.DeviceDesc%=CyUsb, USB\VID_04B4&PID_8613
; Cypress FX1 default ID
%VID_04B4&PID_6473.DeviceDesc%=CyUsb, USB\VID_04B4&PID_6473
; Cypress Streamer Device. CyStream firmware examples use this VID/PID
%VID_04B4&PID_1003.DeviceDesc%=CyUsb, USB\VID_04B4&PID_1003
; Cypress FX2LP Example Device. DVK firmware examples use this VID/PID
%VID_04B4&PID_1004.DeviceDesc%=CyUsb, USB\VID_04B4&PID_1004
[CYUSB]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.NT]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.NT.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.NT.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.NTx86]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.NTx86.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.NTx86.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.NTamd64]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.NTamd64.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.NTamd64.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.AddReg]
; Deprecating - do not use in new apps to identify a CYUSB driver
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,CYUSB.sys
; You may optionally include a check for DriverBase in your application to check for a CYUSB driver
HKR,,DriverBase,,CYUSB.sys
HKR,"Parameters","MaximumTransferSize",0x10001,4096
HKR,"Parameters","DebugLevel",0x10001,2
HKR,,FriendlyName,,%CYUSB_Description%
[CYUSB.AddService]
DisplayName = %CYUSB_Description%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\System32\Drivers\CYUSB.sys
AddReg = CYUSB.AddReg
LoadOrderGroup = Base
[CYUSB.Files.Ext]
CYUSB.sys
[CYUSB.AddReg.Guid]
HKR,,DriverGUID,,%CYUSB.GUID%
[Strings]
CYUSB_Provider = "Cypress"
CYUSB_Company = "Cypress Semiconductor Corporation"
CYUSB_Description = "Cypress Generic USB Driver"
CYUSB_DisplayName = "Cypress USB Generic"
CYUSB_Install = "Cypress CYUSB Driver Installation Disk"
VID_04B4&PID_8613.DeviceDesc="Cypress EZ-USB FX2LP No EEPROM"
VID_04B4&PID_6473.DeviceDesc="Cypress EZ-USB FX1 - No EEPROM"
VID_04B4&PID_1004.DeviceDesc="Cypress EZ-USB Example Device"
VID_04B4&PID_1003.DeviceDesc="Cypress EZ-USB Streamer Device"
VID_XXXX&PID_XXXX.DeviceDesc="Cypress USB Generic Driver (3.4.4.000)"
CYUSB.GUID="{AE18AA60-7F6A-11d4-97DD-00010229B959}"
CYUSB_Unused = "."
回答by BastianW
Another option (the Microsoft way, without doing random unknown deletings in the registry) is to start CMD as "run as admin" and then list all installed drivers in the Windows 7 driver store via:
另一种选择(Microsoft 方式,无需在注册表中进行随机的未知删除)是以“以管理员身份运行”的方式启动 CMD,然后通过以下方式列出 Windows 7 驱动程序存储中的所有已安装驱动程序:
pnputil -e
pnputil -e
if this caused a longer list you can pipe that into a file via:
如果这导致列表变长,您可以通过以下方式将其导入文件:
pnputil -e > C:\driverexport.txt
pnputil -e > C:\driverexport.txt
If you have found now the driver you need to remove use the following comand:
如果您现在找到了需要删除的驱动程序,请使用以下命令:
pnputil.exe -d OemNUMBER.inf
pnputil.exe -d OemNUMBER.inf
replace NUMBER with your number from your example. You might try to use -F to force the uninstallation. Once a reboot is done the driver should be gone.
用您的示例中的号码替换 NUMBER。您可以尝试使用 -F 强制卸载。重新启动完成后,驱动程序应该消失了。
This might be also usefull to delete old drivers and get some HD space back.
这对于删除旧驱动程序并取回一些高清空间也可能很有用。
回答by Preston
If you have installed a driver for a device and you want to remove it (and the driver store) just plug in your device. Open Device Manager, right click the device and select Uninstall. There will be a box that says "Remove driver software" - check this box and Uninstall the driver. This should remove it from the driver store and uninstall the device from the registry.
如果您已经为设备安装了驱动程序并且想要删除它(和驱动程序存储),只需插入您的设备即可。打开设备管理器,右键单击设备并选择卸载。将出现一个显示“删除驱动程序软件”的框 - 选中此框并卸载驱动程序。这应该将其从驱动程序存储中删除并从注册表中卸载该设备。
If all drivers for the device has been removed you should be able to plug it in and see that no driver loads for the device. If it does there could be multiple versions in your driver store and you go through the same steps until Windows doesn't recognize the device.
如果设备的所有驱动程序都已删除,您应该能够将其插入并看到没有为该设备加载驱动程序。如果是这样,您的驱动程序存储中可能有多个版本,您将执行相同的步骤,直到 Windows 无法识别该设备。
Note that the SYS file will remain in the C:\Windows\System32\drivers directory per policy, but if all devices and installations are removed that use it you can safely delete this driver as well.
请注意,SYS 文件将保留在每个策略的 C:\Windows\System32\drivers 目录中,但如果删除所有使用它的设备和安装,您也可以安全地删除此驱动程序。
回答by t4u51f
While the steps mentioned in answers above may be correct, this is a significantly easier method to do it:
虽然上面答案中提到的步骤可能是正确的,但这是一种更简单的方法:
Go to Device Manageror alternatively run the command
转到设备管理器或运行命令
devmgmt.msc
开发管理工具
Right-click the device you need to uninstall and go to Properties. Select the Detailstab and then select INF Namefrom the drop-down list
右键单击您需要卸载的设备,然后转到“属性”。选择详细信息选项卡,然后从下拉列表中选择INF 名称
Once you have the INF Name type in this command in a command window opened with Admin privileges
在使用管理员权限打开的命令窗口中的此命令中输入 INF 名称后
pnputil.exe -d INFName.inf
pnputil.exe -d INFName.inf
if you face issues try forced deletion
如果您遇到问题,请尝试强制删除
pnputil.exe -f -d INFName.inf
pnputil.exe -f -d INFName.inf