Uninstall a device

  • Thread starter Thread starter Mac
  • Start date Start date
M

Mac

Hi folks,

As you all know, in DeviceManager you select a Device using right Mouseclick
and select Uninstall to remove this Device (no matter wich kind of device)..
My question is: Can someone give me a WORKING example on how to uninstall a
existing device from a Windows XP,2K or 2K3 Platform.

VB and VB.NET Sources welcome ;-)
 
Hi Mac,

I think you should be looking at the SetupDiRemoveDevice function that lives
in setupapi.dll.

Here is the newsgroup post, with code in C++, that led me there:
http://groups.google.com/group/micr...read/thread/191a96ba565a4043/7423a91958887ed7

The Declaration should look something like this:

Private Declare Function SetupDiRemoveDevice Lib "setupapi.dll" ( _
ByRef DeviceInfoSet As Int32, _
ByRef DeviceInfoData As PSP_DEVINFO_DATA) As Int32

As far as the PSP_DEVINFO_DATA goes I'm not really sure

MSDN link
http://msdn.microsoft.com/library/d..._ab1e54f4-687d-4db2-8799-c33c1e0e3d25.xml.asp

I hope this is helpful as I'm just taking a guess here.

Chris
 
Back
Top