If the program is run from somewhere other than the Command shell (or PowerShell) a temporary shell is created to run the program but this closes when the program finishes. Thus the port list report is lost. So detect when to pause at the end of the program and wait for a key press (e.g. space or carriage return).
If the program is run from somewhere other than the Command shell (or PowerShell) a temporary shell is created to run the program but this closes when the program finishes. Thus the port list report is lost. So detect when to pause at the end of the program and wait for a key press (e.g. space or carriage return).