When you ask for technical support, the support team usually wants to check that the basics are working on your PC. At the request of MIDI hardware partners, mididiag.exe produces a text report of the state of MIDI on your PC that both a person and a script can read.
The report can be long. It starts with some basics about your PC and then covers the state of each part of Windows MIDI Services.
The report tells you:
… 
To save the report to a file, redirect the output:
C:\Users\peteb>cd Documents
C:\Users\peteb\Documents>mididiag > mididiag-output.txt
Then send mididiag-output.txt to whoever asked for it, by email, a support form upload, or any other way you like.
The MIDI Troubleshooting and Repair app can run this same report for you, with buttons to copy or save the output, if you’d rather not use a command prompt.
We may add fields or sections in the future. If you’re parsing this file with a script, don’t rely on the order of the fields or sections. Field names and section headers stay the same, so it’s safe to match on those. They aren’t translated.
The date and time at the top of the file, and the times in the list of connected apps, use the PC’s own time zone. Dates are in YYYY-MM-DD format, and times use a 24-hour clock.
The program returns 0 when it succeeds, and non-zero when it fails.