tags:

views:

73

answers:

1

Hi, Is it possible to programmatically uninstall a device in windows and perform a 'scan for hardware changes' programmatically? Is there any VB script that can be used for the same? Or is there any windows APi that can be called to achieve the same?

Please guide.

Thank you

Ananth

+1  A: 

To force the 'scan for hardware changes' checkout "How To Force Reenumeration of a Device Tree From an Application" the sample there shows how to force the entire tree to be re-enumerated.

As to removing a driver checkout DiUninstallDevice.

Ruddy
Hi Ruddy,Thank you very much for the post. I will try out the links that you had pointed to.RegardsAnanth
Hi,Thank you so much for the response. I was trying to execute the program in the link, http://support.microsoft.com/kb/259697But I found out that this requires the file cfgmgr32.lib to be included. I was unable to find that file anywhere in my SDK folders, nor in the internet.Can you please guide me in this regard?RegardsAnanth