On TechNet you’ll find an article the describes the command line usage for a tool called the Microsoft Support Diagnostic Tool (MSDT.EXE), which you can use to launch a Windows Troubleshooting Pack from (obviously) the command line. The article has all the details, but I thought I’d take a moment today to give folks the short and sweet version.
To run an inbox troubleshooter that ships with Windows 7 from the command line use this command
msdt.exe /id <diagnostic_id>
Example: msdt.exe /id NetworkDiagnosticsWeb
To run a custom-built troubleshooter stored locally use this command line
msdt.exe /path <path_to_troubleshooter>
Example: msdt.exe /path c:\troubleshooters\myTroubleshooter
or, if the troubleshooter is a .diagcab file
msdt.exe /cab <path_to_diagcab>
Example: msdt.exe /cab c:\troubleshooters\myTroubleshooter.diagcab
Starting troubleshooters from the command line is really powerful when you combine it with your own experiences running on Windows 7. Application developers can take advantage of these troubleshooters to help their customers fix problems that may prevent them from getting the best possible experience. For example, and application which requires internet connectivity can invoke the Windows 7 Networking troubleshooter rather than presenting a error message that the network isn’t available. To accomplish this, all the developer needs to do is run the “msdt.exe /id NetworkDiagnosticsWeb” command line. The troubleshooter will take care of the rest.
Here is a short list of troubleshooter IDs to get you started, the rest can be found here.
Troubleshoots problems using hardware and access devices connected to the computer.
Troubleshoots problems connecting to the Internet or to a specific Web site.
Troubleshoots problems playing sounds and other audio files.
Troubleshoots problems printing.