This is a mirror of official site: http://jasper-net.blogspot.com/

Working with devices

| Thursday, June 17, 2010
I talked to several folks at Tech Ed who wanted to know if it was possible to work with devices and do something like an uninstall/reinstall using a Troubleshooting Pack.  Yes, you absolutely can!  In fact, there are two ways you can accomplish this, so I’ll show you both.

Method 1: Reuse the Windows “Devices” Troubleshooting Pack
This is definitely the method I’d recommend.  It doesn’t take a lot of effort and you can get really good results.  Windows 7 includes a great devices troubleshooter that can do much more than just uninstall and reinstall devices, and you’ll get all that extra goodness for free!  Since it’s included with Windows 7 you know it’ll be there.  All we need to do is tap into that workflow; let’s look at how you can do that.

If you don’t know which device is having problems you can just launch the device troubleshooter and it’ll try to figure it out.  Launching this Troubleshooting Pack from the command line is simple, just type the following command.  This is identical to launching the Troubleshooting Pack from the Troubleshooting Control Panel.

msdt.exe /id DeviceDiagnostic /skip true

If there is a specific device that’s causing you problems you can pass the PNPDeviceID for that device to the Troubleshooting Pack.  To do this we must change the command line slightly.  We’ve added the “/param” command line argument so we can pass in the specific PNPDeviceID of the problem device.  Obviously, you need to know the PNPDeviceID for the problem device for this to be useful.  This is identical to right-clicking a device in Devices and Printers and selecting Troubleshoot.

msdt.exe /id DeviceDiagnostic /param "IT_SelectDevice=[PNPDeviceID]" /skip true

Example:
msdt.exe /id DeviceDiagnostic /param "IT_SelectDevice=PCI\VEN_8086&DEV_27D8&SUBSYS_380217AA&REV_02\3&21436425&0&D8" /skip true

This is the best approach for general device issues.  It’ll enable devices that have been disabled, search for drivers, and address several other potential problems.

Method 2: Build an Uninstall/Reinstall Troubleshooting Pack
The second way to uninstall and reinstall a device is to build your own Troubleshooting Pack.  This is more work but will give you complete control over the experience.

Read more: Matt Bielman

Posted via email from .NET Info

0 comments: