Hi,
Is there a way to delete or cleanup keys in
HKEY_LOCAL_MACHINE\System\currentControlSet\Enum\PCI ?
Mine has a lots of keys in this location even if the related HW is removed
from PC.
When I try to delete a key (the related HW is no longer on PC) I have the
popup messgage
Error Deleting Key
Cannot delete VEN_xxx .Error while deleteting key.
the reason I want to do this is:
for tetsing my win2k drivers, sometime I have to make my test machine
“clean” as the first time the driver insstall.
Thanks for your help
QUANG
You can change the security on the Enum keys and do anything you want,
however might I suggest that this does not give you a “clean” environment,
and that instead you should invest in ghost or a similar product and create
a truly clean image that you can quickly revert back to?
=====================
Mark Roddy
-----Original Message-----
From: Quang Vu [mailto:xxxxx@gage-applied.com]
Sent: Wednesday, September 24, 2003 11:04 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Win 2000 PCI keys Registry Clean up
Hi,
Is there a way to delete or cleanup keys in
HKEY_LOCAL_MACHINE\System\currentControlSet\Enum\PCI ?
Mine has a lots of keys in this location even if the related
HW is removed from PC.
When I try to delete a key (the related HW is no longer on
PC) I have the popup messgage
Error Deleting Key
Cannot delete VEN_xxx .Error while deleteting key.
the reason I want to do this is:
for tetsing my win2k drivers, sometime I have to make my test
machine “clean” as the first time the driver insstall.
Thanks for your help
QUANG
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Are U sure you logged on with admin priv. to the del…
-prokash
----- Original Message -----
From: “Quang Vu”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, September 24, 2003 8:04 AM
Subject: [ntdev] Win 2000 PCI keys Registry Clean up
> Hi,
>
> Is there a way to delete or cleanup keys in
> HKEY_LOCAL_MACHINE\System\currentControlSet\Enum\PCI ?
>
> Mine has a lots of keys in this location even if the related HW is removed
> from PC.
>
> When I try to delete a key (the related HW is no longer on PC) I have the
> popup messgage
>
> Error Deleting Key
> Cannot delete VEN_xxx .Error while deleteting key.
>
>
> the reason I want to do this is:
> for tetsing my win2k drivers, sometime I have to make my test machine
> “clean” as the first time the driver insstall.
>
>
> Thanks for your help
> QUANG
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
Yes you can do this, you need to change the security setting on the
key first. The procedure for removing a device for testing that I use
is:
Removing all traces of a driver from a system
When testing a device install developers want to cleanup the system so
they can try reinstalling the device, unfortunately this is something
Microsoft hasn’t provided an easy way to do. The steps needed are:
-
Delete the files copied by the INF from the system.
-
Delete the INF and corresponding PNF files for the device, from the
inf directory off of the system root. Note, this file is named OEM*.INF and
OEM*.PNF if your driver is not signed. Searching the OEM*.INF files for
your device identifier will determine the OEM* name of your inf file.
-
If your device has a unique class, delete the registry entry in
HLKM\System\CurrentControlSet\Control\Class corresponding to the device
class you created for device. Note the key is named for the GUID of the
class.
-
If your device has a CoInstaller, delete the registry entry in
HLKM\System\CurrentControlSet\Control\CoDeviceInstallers corresponding to
the device class you created for device. Note the key is named for the GUID
of the class.
-
Delete the registry entries in HLKM\System\CurrentControlSet\Enum
corresponding to the device you specified in the inf file. For PCI devices
this is under the PCI key, for legacy devices this is under the Root key.
Note: if you specify more than one device in the inf, you will have an entry
for each device type the system has seen. DELETING THIS KEY REQUIRES
CHANGING ITS SECURITY FIRST.
-
Delete the registry entry in
HLKM\System\CurrentControlSet\Services corresponding to the driver you
specified in the inf file. Note this is the standard cleanup one would have
done in the pre-PNP days.
-
Reboot the system, now that was easy and intuitive wasn’t it.
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
----- Original Message -----
From: “Quang Vu”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, September 24, 2003 11:04 AM
Subject: [ntdev] Win 2000 PCI keys Registry Clean up
> Hi,
>
> Is there a way to delete or cleanup keys in
> HKEY_LOCAL_MACHINE\System\currentControlSet\Enum\PCI ?
>
> Mine has a lots of keys in this location even if the related HW is removed
> from PC.
>
> When I try to delete a key (the related HW is no longer on PC) I have the
> popup messgage
>
> Error Deleting Key
> Cannot delete VEN_xxx .Error while deleteting key.
>
>
> the reason I want to do this is:
> for tetsing my win2k drivers, sometime I have to make my test machine
> “clean” as the first time the driver insstall.
>
>
> Thanks for your help
> QUANG
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com
Thanks for quick reponse
How can I chnage the security setting of the key ?
I was logging in as Administrator
Thank you Don for the tips.
How I can change the security setting for the key ?
I was logging in as administrator
best regards,
QUANG
Choose the key, select permissions under the security menu of regedt32.
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
----- Original Message -----
From: “Quang Vu”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, September 24, 2003 11:45 AM
Subject: [ntdev] RE: Win 2000 PCI keys Registry Clean up
> Thanks for quick reponse
> How can I chnage the security setting of the key ?
> I was logging in as Administrator
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com
Don,
you wrote on Wednesday, September 24, 2003, 17:13:38:
DB> 6. Delete the registry entry in
DB> HLKM\System\CurrentControlSet\Services corresponding to the driver you
DB> specified in the inf file. Note this is the standard cleanup one would have
DB> done in the pre-PNP days.
Better use the SCM APIs (OpenService, DeleteService) for this. If you
simply delete the service registry key and then immediately try to
install the driver again without rebooting,
UpdateDriversForPlugAndPlayDevices will fail with error 2 (The system
cannot find the file specified).
Ralf.
And if you do the other step and do not reboot the items will
still be in the registry. You have to reboot after cleaning out
this stuff, to be sure you have a clean registry.
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
----- Original Message -----
From: “Ralf Buschmann”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, September 24, 2003 1:44 PM
Subject: [ntdev] Re: Win 2000 PCI keys Registry Clean up
> Don,
>
> you wrote on Wednesday, September 24, 2003, 17:13:38:
>
> DB> 6. Delete the registry entry in
> DB> HLKM\System\CurrentControlSet\Services corresponding to the driver you
> DB> specified in the inf file. Note this is the standard cleanup one
would have
> DB> done in the pre-PNP days.
>
> Better use the SCM APIs (OpenService, DeleteService) for this. If you
> simply delete the service registry key and then immediately try to
> install the driver again without rebooting,
> UpdateDriversForPlugAndPlayDevices will fail with error 2 (The system
> cannot find the file specified).
>
> Ralf.
> –
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com
Don,
you wrote on Wednesday, September 24, 2003, 19:47:26:
> DB> 6. Delete the registry entry in
> DB> HLKM\System\CurrentControlSet\Services corresponding to the driver you
> DB> specified in the inf file. Note this is the standard cleanup one would have
> DB> done in the pre-PNP days.
>
> Better use the SCM APIs (OpenService, DeleteService) for this. If you
> simply delete the service registry key and then immediately try to
> install the driver again without rebooting,
> UpdateDriversForPlugAndPlayDevices will fail with error 2 (The system
> cannot find the file specified).
DB> And if you do the other step and do not reboot the items will
DB> still be in the registry. You have to reboot after cleaning out
DB> this stuff, to be sure you have a clean registry.
Hmm, not for me
I have written an installer/uninstaller for a
virtual hardware PnP driver of ours and the service registry key is
definitely deleted after calling DeleteService, without rebooting. Of
course the device needs to be uninstalled via the SetupDi APIs first.
On uninstalling, what I do is basically (in this order):
-
get the INF file name and section that was installed from
(SetupDiOpenDevRegKey, query InfPath, InfSection and InfSectionExt)
-
get the service name (SetupDiGetDeviceRegistryProperty for
SPDRP_SERVICE)
-
remove the device (SetupDiCallClassInstaller for DIF_REMOVE)
-
remove the service (OpenSCManager, OpenService, DeleteService)
-
delete driver files (scan DDInstall and DDInstall.CoInstallers in INF
section for files to delete, use Setup APIs)
-
delete INF and PNF file (W2K)/call SetupUninstallOEMInf (XP+)
This ensures I can immediately reinstall the driver, without rebooting.
Ralf.
Quang,
Microsoft has a tool called Scrubber that cleans up all the phantom
devices in the Enum key. I am not sure if this is free. You can search for
this.
If you system has a lot of phantom devices then this is the perfect
solution.
Peter Trinh
Scrubber is designed to clean up stale registry data for storage devices
(disk, volume, partition). It is free if you know which Q article to ask
for and guess the symptoms it cures ;). A new version will be posted
shortly that works with XP and Windows Server 2003.
http://support.microsoft.com/default.aspx?scid=kb;en-us;277222
Jeff Goldner
-----Original Message-----
From: Peter Trinh [mailto:xxxxx@verizon.net]
Sent: Wednesday, September 24, 2003 12:32 PM
Subject: Re: Win 2000 PCI keys Registry Clean up
Quang,
Microsoft has a tool called Scrubber that cleans up all the phantom
devices in the Enum key. I am not sure if this is free. You can search
for
this.
If you system has a lot of phantom devices then this is the perfect
solution.
Peter Trinh