There are two sides to this question. You may want to execute a program from the command prompt on the server side, after a click in a hyperlink server control, or you may want to open the commmand prompt on the client side after the user clicks a link.
The first case may be achieved with the following code in the hyperlink's click event handler:
You can also use the ProcessStartInfo class in the same namespace to gain better control over the process execution, such as redirecting the standard input/output streams, waiting for completion, etc.
The second case is a matter of client-side scripting. I'm sure there are other ways of doing this, but one of them is using the Shell object from WSH (which must be installed on the client machine, of course):
Set WshShell = CreateObject("WScript.Shell") WshShell.Run("cmd.exe")
You will receive the usual warning about security and ActiveX execution.
This was first published in February 2003