On my website, using a direct connection button, it uses this code to prevent the use of a meta redirect for the connection method. Instead, executes a command to the Windows Shell through JavaScript.