Is it possible to automate a driver change on Windows for a plug&play peripheral?

See the Driver Loader utility at http://www.osronline.com/article.cfm?article=157.
This might solve your problem.


Interesting question. This isn't a full answer, unfortunately, since I've been out of Windows driver development for a few years. Hopefully it will help put you on the right track.

A quick search found this thread at OSRonline. It's old, but is fairly direct:

You can use device manager and disable the device to unload, and enable to reload as has been stated by others here. BTW, the driver will only unload if every instance of the device is disabled.

Also, you can disable/enable programmatically. Look at the devcon sample in the latest DDK to see how that is done. In fact, the devcon sample is essentially a command line device manager with source, it has a wealth of useful information in it.

If you can find the devcon utility (seems available at that KB article; I'm not sure it's still available in the current Windows DDK) you may be able to whip up a batch script to disable your PnP devices and swap drivers. Such a script might need to load in a registry change to swap the drivers, but devcon should allow the script to perform the disable/enable.