Using 'devcon dp_delete' to purge the system of third party driver files

Given that our machines are used for testing on a nightly basis, ‘devcon dp_enum’ shows hundreds and hundreds of instances for the device that I am trying to test. The drivers are picked up from our build server, signed, and installed using devcon update.

One machine, for example, has oem*.inf files up to oem1259.inf; we have reason to believe that the huge number of cached driver versions is causing performance problems loading and unloading the driver.

Is it possible to use ‘devcon dp_delete’, or achieve the same functionality using other commands, to clean up these files in bulk? It would really be a good experiment to see if it speeds things up

> -----Original Message-----

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joseph Koenig
Sent: Wednesday, July 29, 2009 1:16 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Using ‘devcon dp_delete’ to purge the system
of third party driver files

Is it possible to use ‘devcon dp_delete’, or achieve the same
functionality using other commands, to clean up these files
in bulk? It would really be a good experiment to see if it
speeds things up

I don’t think so but it should be easy to create a batch or even call it
from command line. What I’d do:

  • copy all oemNNN.inf somewhere
  • search them for some string which exists only in my INF and delete all
    other files
  • run something like “for %a in (*.inf) do devcon dp_delete %a”

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

I do the following to clean up the driver store after test runs:

for %i in %windir%\inf\oem*.inf do (devcon dp_delete %i)

dp_delete won’t delete a driver package if it’s installed on an device, so as long as you’ve uninstalled all of the test devices that were using those drivers this should clean it out. But it’s not fast.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Joseph Koenig
Sent: Tuesday, July 28, 2009 4:16 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Using ‘devcon dp_delete’ to purge the system of third party driver files

Given that our machines are used for testing on a nightly basis, ‘devcon dp_enum’ shows hundreds and hundreds of instances for the device that I am trying to test. The drivers are picked up from our build server, signed, and installed using devcon update.

One machine, for example, has oem*.inf files up to oem1259.inf; we have reason to believe that the huge number of cached driver versions is causing performance problems loading and unloading the driver.

Is it possible to use ‘devcon dp_delete’, or achieve the same functionality using other commands, to clean up these files in bulk? It would really be a good experiment to see if it speeds things up


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

If you are looking to delete a driver package on an installed device, “pnputil -f -d” will do the trick. Pnputil comes inbox.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Tuesday, July 28, 2009 4:33 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Using ‘devcon dp_delete’ to purge the system of third party driver files

I do the following to clean up the driver store after test runs:

for %i in %windir%\inf\oem*.inf do (devcon dp_delete %i)

dp_delete won’t delete a driver package if it’s installed on an device, so as long as you’ve uninstalled all of the test devices that were using those drivers this should clean it out. But it’s not fast.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Joseph Koenig
Sent: Tuesday, July 28, 2009 4:16 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Using ‘devcon dp_delete’ to purge the system of third party driver files

Given that our machines are used for testing on a nightly basis, ‘devcon dp_enum’ shows hundreds and hundreds of instances for the device that I am trying to test. The drivers are picked up from our build server, signed, and installed using devcon update.

One machine, for example, has oem*.inf files up to oem1259.inf; we have reason to believe that the huge number of cached driver versions is causing performance problems loading and unloading the driver.

Is it possible to use ‘devcon dp_delete’, or achieve the same functionality using other commands, to clean up these files in bulk? It would really be a good experiment to see if it speeds things up


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

for /f “usebackq tokens=4 delims=:” %i in (find /c "<string-to-match>"<br>%windir%\inf\oem*.inf ^| find /v ".INF: 0" ^| find ".INF:") do devcon
dp_delete %i

is the latest incarnation of a command string I use to do essentially this -
rip out all of the OEM.inf files that have a particular string in them.

I have often wished for some better way to do this based on DeviceId but
this has served pretty well in the testing environment.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Tuesday, July 28, 2009 7:47 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Using ‘devcon dp_delete’ to purge the system of third
party driver files

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Joseph Koenig
> Sent: Wednesday, July 29, 2009 1:16 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Using ‘devcon dp_delete’ to purge the system
> of third party driver files
>
> Is it possible to use ‘devcon dp_delete’, or achieve the same
> functionality using other commands, to clean up these files
> in bulk? It would really be a good experiment to see if it
> speeds things up

I don’t think so but it should be easy to create a batch or even call it
from command line. What I’d do:

- copy all oemNNN.inf somewhere
- search them for some string which exists only in my INF and delete all
other files
- run something like “for %a in (*.inf) do devcon dp_delete %a”

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Have you considered a script written in PowerShell V2.0? You should be able
to search the registry for your driver name, and isolate the most current
OEM*INF file using the Vendor/Device ID or even the name of your driver sys
file. Once you know the name of the INF file erase the INF/PNF pair and do
the install. Using PS you should be able to do the initial hunt for the oem
file from the command line to develop the script.

The personal opinion of
Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Tuesday, July 28, 2009 6:47 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Using ‘devcon dp_delete’ to purge the system of third
party driver files

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joseph Koenig
Sent: Wednesday, July 29, 2009 1:16 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Using ‘devcon dp_delete’ to purge the system
of third party driver files

Is it possible to use ‘devcon dp_delete’, or achieve the same
functionality using other commands, to clean up these files
in bulk? It would really be a good experiment to see if it
speeds things up

My recommendation is any of:

  1. make the system disk on some storage server that supports snapshots, and
    roll back the volume to a clean OS as needed

  2. make an image of the system disk using imagex and write some scripts that
    restore it from a network share

  3. it’s been suggested that Win7 can not only boot from a .vhd, it can boot
    from a differencing .vhd, haven’t tried it yet

  4. if your driver is not for hardware (like many drivers) you can also just
    run in a VM and revert the differencing disk or restore a VM snapshot

For a long time I did #2. I’d PXE boot to WinPE and had a script on the
loaded ramdisk that reformatted my system disk and restored a clean image of
it, this whole process from shutdown of the polluted system disk to login on
the restored clean image was about 5 minutes (including PXE booting, and
booting the clean OS). I also flipped between W2K3/W2K8, 32/64 bit,
free/checked OS, this way, by having multiple images to choose from.

If you have the appropriate environment, a fibre channel boot disk and a
EMC/NetApp virtual volume server, #1 is the way to go. I suppose if you can
iSCSI boot, you might make this work with iSCSI too.

Doing testing from a clean and very consistent base helps a lot, and all
methods that try to delete state back to what is was often don’t REALLY get
you back to exactly the original state, so your tests are running under a
constantly shifting base. Restoring images or snapshot rollbacks are very
consistent. You can even save images in assorted states, like testing
upgrades from a previous release version. I can’t tell you how many hours I
wasted because QA tested a driver in a corrupted environment. My question
always was “what environment did you test it in” and if the answer wasn’t
“clean OS with ONLY files off the install CD”, with some fudging because of
things like NIC drivers, but no fudging allowed for things like open source
scripting systems or even major brand anti-virus software. I’d want to see
the problem reproduced in a clean environment before I was going to spend 2
days digging into it. If QA wants to know the compatibility with some other
app/driver, then the only way to get meaningful delta data is compare with
one variable changing, the addition of the extra software/hardware. Doing
software QA any other way is like doing chemical tests with equipment
covered with contamination. Minimizing the number of variables is important.

Jan

Given that our machines are used for testing on a nightly
basis, ‘devcon dp_enum’ shows hundreds and hundreds of
instances for the device that I am trying to test. The
drivers are picked up from our build server, signed, and
installed using devcon update.

One machine, for example, has oem*.inf files up to
oem1259.inf; we have reason to believe that the huge number
of cached driver versions is causing performance problems
loading and unloading the driver.

Is it possible to use ‘devcon dp_delete’, or achieve the same
functionality using other commands, to clean up these files
in bulk? It would really be a good experiment to see if it
speeds things up

I have found that once I have a base level machine ready to install my drivers I do a manual System Restore Point. When I have sufficiently mangled the OS with my driver testing I do a System Restore from the manual one I created.

Works for me.

Larry C

Symantec Ghost works very well. I can restore any image even for Win7 in
less than 10 minutes (most less than 3 minutes) since the only thing is the
patched OS and a few tools in the image.

wrote in message news:xxxxx@ntdev…
>I have found that once I have a base level machine ready to install my
>drivers I do a manual System Restore Point. When I have sufficiently
>mangled the OS with my driver testing I do a System Restore from the manual
>one I created.
>
> Works for me.
>
> Larry C
>

David (and others who have graciously replied to this thread),

Thanks for the feedback. Using PowerShell I was able to automate this.

I like the idea of using manually recreated restore points. We already used ghost, but it is occasionally problematic; the manual restore point trick seems great.

I’ll incorporate it into existing test beds, if only we had the time :slight_smile:

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
Sent: Wednesday, July 29, 2009 9:50 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Using ‘devcon dp_delete’ to purge the system of third party driver files

Symantec Ghost works very well. I can restore any image even for Win7 in
less than 10 minutes (most less than 3 minutes) since the only thing is the
patched OS and a few tools in the image.

wrote in message news:xxxxx@ntdev…
>I have found that once I have a base level machine ready to install my
>drivers I do a manual System Restore Point. When I have sufficiently
>mangled the OS with my driver testing I do a System Restore from the manual
>one I created.
>
> Works for me.
>
> Larry C
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

The only problem with the manual restore point is that every time you install your driver a new restore point is generated. After a while your manual restore point will get purged as being old (I guess). To prevent the purge I will occasionally do a System restore of the manual restore and then do another manual restore right away to get a fresh one.

Larry C

Windows Complete PC Backup is, in my opinion, superior to anything that
Symantec has, or ever had … comes with the operating system … and you
don’t have the boluxed up Symantec drivers that fail Driver Verifier. Ok …
I decided Ghost was crap when it hosed my boot back in XP and they want $95
for me to report the frigging bug. That was 6 years ago. Tried it again 3
years ago at Seagate and still found it crap. But that is my opinion.

If you REALLY want to pay for barebones back and get an active, scheduled
backup, then StorageCrafts ShadowProtect is what I would get.

Hmmm … guess it won’t do any good to send my resume to Symantec, now will
it? :slight_smile:

The personal opinion of
Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
Sent: Wednesday, July 29, 2009 11:50 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Using ‘devcon dp_delete’ to purge the system of third
party driver files

Symantec Ghost works very well. I can restore any image even for Win7 in
less than 10 minutes (most less than 3 minutes) since the only thing is the
patched OS and a few tools in the image.

wrote in message news:xxxxx@ntdev…
>I have found that once I have a base level machine ready to install my
>drivers I do a manual System Restore Point. When I have sufficiently
>mangled the OS with my driver testing I do a System Restore from the manual

>one I created.
>
> Works for me.
>
> Larry C
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

What drivers? Symantec Ghost does not use drivers. It doesn’t use Windows,
but DOS. I think there are some network drivers for the central server
storage of backup images, but I just use another hard drive for them, which
requires no drivers. I find the USB and 1394a drives do work most of the
time, but the latest few versions of Ghost have moved the code into the
executable instead of using a third party DOS driver. If you order Symantec
Ghost you can get maintenance support too since the minimum purchase is 5
licenses to start. I think you can purchase them in various quantities
after the first purchase. That is sometimes expensive, but the product is
marketed to corporations and not the consumer market. They have a Norton
Ghost for consumers which is for backing up and I use it too. That version
works under Windows and allows continued use of the machine during the
backup. It has full and incremental capabilities also with scheduling. It
used to be called DriveImage before Symantec bought PowerQuest.

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> Windows Complete PC Backup is, in my opinion, superior to anything that
> Symantec has, or ever had … comes with the operating system … and you
> don’t have the boluxed up Symantec drivers that fail Driver Verifier. Ok
> …
> I decided Ghost was crap when it hosed my boot back in XP and they want
> $95
> for me to report the frigging bug. That was 6 years ago. Tried it again 3
> years ago at Seagate and still found it crap. But that is my opinion.
>
> If you REALLY want to pay for barebones back and get an active, scheduled
> backup, then StorageCrafts ShadowProtect is what I would get.
>
> Hmmm … guess it won’t do any good to send my resume to Symantec, now
> will
> it? :slight_smile:
>
> The personal opinion of
> Gary G. Little
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
> Sent: Wednesday, July 29, 2009 11:50 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Using ‘devcon dp_delete’ to purge the system of third
> party driver files
>
> Symantec Ghost works very well. I can restore any image even for Win7 in
> less than 10 minutes (most less than 3 minutes) since the only thing is
> the
> patched OS and a few tools in the image.
>
> wrote in message news:xxxxx@ntdev…
>>I have found that once I have a base level machine ready to install my
>>drivers I do a manual System Restore Point. When I have sufficiently
>>mangled the OS with my driver testing I do a System Restore from the
>>manual
>
>>one I created.
>>
>> Works for me.
>>
>> Larry C
>>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>

Damn, ye kinna read my mind David!?!? :slight_smile:

I mentally switched, while writing that, from Ghost to the Symantec system
security I had. There they do have drivers and I of course decided to use DV
on them. They failed. Miserably. Yes, Ghost uses DOS, whereas ShadowProtect
uses a windows pre-boot environment and works a little bit more
intelligently, plus it activley updates the backup on a scheduled basis in
the background. The fact is that of all the barebones backup I have used,
Ghost has a history of being the most unreliable and catastrophic.

My solution to the OP question was a combination of XP/Vista SystemRestore
with Complete PC Backup or ShadowProtect as the ultimate hammer to get to a
pristine install environment. I also periodically deleted the OEM*.*NF files
that had my drivers names in it. Then I used a DOS command line. Now I would
write a Powershell script that could be used to do the needed cleanup,
including registry entries, or possibly control the entire shebang.

The personal opinion of
Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
Sent: Wednesday, July 29, 2009 8:17 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Using ‘devcon dp_delete’ to purge the system of third
party driver files

What drivers? Symantec Ghost does not use drivers. It doesn’t use Windows,

but DOS. I think there are some network drivers for the central server
storage of backup images, but I just use another hard drive for them, which
requires no drivers. I find the USB and 1394a drives do work most of the
time, but the latest few versions of Ghost have moved the code into the
executable instead of using a third party DOS driver. If you order Symantec

Ghost you can get maintenance support too since the minimum purchase is 5
licenses to start. I think you can purchase them in various quantities
after the first purchase. That is sometimes expensive, but the product is
marketed to corporations and not the consumer market. They have a Norton
Ghost for consumers which is for backing up and I use it too. That version
works under Windows and allows continued use of the machine during the
backup. It has full and incremental capabilities also with scheduling. It
used to be called DriveImage before Symantec bought PowerQuest.

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> Windows Complete PC Backup is, in my opinion, superior to anything that
> Symantec has, or ever had … comes with the operating system … and you
> don’t have the boluxed up Symantec drivers that fail Driver Verifier. Ok
> …
> I decided Ghost was crap when it hosed my boot back in XP and they want
> $95
> for me to report the frigging bug. That was 6 years ago. Tried it again 3
> years ago at Seagate and still found it crap. But that is my opinion.
>
> If you REALLY want to pay for barebones back and get an active, scheduled
> backup, then StorageCrafts ShadowProtect is what I would get.
>
> Hmmm … guess it won’t do any good to send my resume to Symantec, now
> will
> it? :slight_smile:
>
> The personal opinion of
> Gary G. Little
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
> Sent: Wednesday, July 29, 2009 11:50 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Using ‘devcon dp_delete’ to purge the system of third
> party driver files
>
> Symantec Ghost works very well. I can restore any image even for Win7 in
> less than 10 minutes (most less than 3 minutes) since the only thing is
> the
> patched OS and a few tools in the image.
>
> wrote in message news:xxxxx@ntdev…
>>I have found that once I have a base level machine ready to install my
>>drivers I do a manual System Restore Point. When I have sufficiently
>>mangled the OS with my driver testing I do a System Restore from the
>>manual
>
>>one I created.
>>
>> Works for me.
>>
>> Larry C
>>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer