2

Is it possible to automate a change of driver for a same peripheral, under Windows ? Typically to switch between two ones. (I'm talking about the kind of driver which doesn't require the computer to reboot, typically).

I have a peripheral for which I use the constructor's driver in some cases, but also a modified driver in other cases. Not that the changing driver is really annoying, but I would like to know if it would be possible to make it easier, like for example in a shortcut. I know the name of the driver, even which files involved.

For more details, the concerned peripheral is a "Xbox360 Gamepad for Windows" (or something like this). The base driver is good for new games, but it doesn't handle correctly older ones (some issues with axes, and vibrations). The modified driver makes it behave like a classic controller, but then it doesn't work correctly on new games (typically using the new version of dxinput linked to the "Games for Windows"). However, this is not a question specific to this gamepad, I'm asking in general about automating this change of drivers.

I currently use Windows XP, so my question is mostly about it, but I'm also interested in the same issue for later versions (Windows 7, most likely).

I'm not really sure if this is even possible, but in case someone has an idea, I'm asking.


Edit: Since asking this question I haven't really been in condition to give it time again, for example to try what harrymc proposed (and now quack). So I apologize for the lack of feedback so far, but I will correct that, some later day.

Gnoupi
  • 8,188

3 Answers3

1

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.

quack quixote
  • 43,504
1

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

harrymc
  • 498,455
0

the proper way would be another hardware profile but that's not really about 'cenvenience' :)

i'm using this method to experiment with different drivers or service configurations, but of course switching profiles requires restart.