Starting "Identify and Repair network problems" Network troubleshooter from commandline

I want to integrate the initiation of this troubleshooter into a python script.

I've found which lists various commands to open different Troubleshooters but the "Identify and Repair Network Problems" is nowhere to be found.

When there's a problem with the internet connection, clicking on the ethernet icon in the system tray opens this troubleshooter or you could open the same by searching "Identify and Repair Network Problems" in the search box of taskbar.

2

1 Answer

You can run the "Identify and Repair Network Problems" troubleshooter using this command line:

msdt -skip TRUE -path C:\Windows\diagnostics\system\networking -ep NetworkDiagnosticsConnectivity

Where -skip TRUE allows you to skip the first screen and go straight into the diagnostics.

or this one:

rundll32.exe,C:\Windows\system32\Rundll32.exe ndfapi,NdfRunDllDiagnoseIncident

If you start the "Identify and Repair Network Problems" troubleshooter and then run wmic process where "caption='rundll32.exe' or caption='msdt.exe'" get /format:csv, you will notice something like the following:

Caption,CommandLine,ParentProcessId,ProcessId
rundll32.exe,C:\Windows\system32\Rundll32.exe ndfapi,NdfRunDllDiagnoseIncident,11088,10272
msdt.exe, -skip TRUE -path C:\Windows\diagnostics\system\networking -af C:\Users\<user>\AppData\Local\Temp\NDFBC7D.tmp -ep NetworkDiagnosticsConnectivity,10272,10528

Based on that, clicking on the troubleshooter shortcut runs C:\Windows\system32\Rundll32.exe ndfapi,NdfRunDllDiagnoseIncident, which starts msdt.exe with an unusual command line that doesn't contain msdt.exe.

This command-line can't be run by itself. The NDFBC7D.tmp file seems to be created by the rundll32.exe process, so removing the -af switch solves that issue and allows you to run the troubleshooter without rundll32.exe.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like