Moreover, you should understand that if port on client's machine is opened this does not mean you can access it from outside, because port should be forwarded by router via which client is linked to internet etc. So in most case you may test only specific port of router which has worldwide IP but you will not see (by usual means at least) to which port on which of the machines behind router this port is forwarded.
There may be some sort of ActiveX control that may work with modern Internet Explorer browsers, but what you are asking is something that should be only done automatically in owned network environments anyways, making that option in almost every case completely unnecessary.
You may be able to code some .js files that would have to be distributed through to each client that accesses and returns information from command prompt executables. The distribution for .js files to clients is usually done through "Group Policies". In this case, JScript can be used to do what you want accomplished, and AJAX could also be used to centralize the information on a server.
Looks like your test page isn't testing access to local ports, but remote ports. I just briefly skimmed the wiki page on the protocol it's testing, and it appears as though the client establishes the connection with the server. I validated this hypothesis to some extent by setting my machine's firewall was aggressively reject all incoming connections -- still passed.