<script>
var WshShell = new ActiveXObject("WScript.Shell");
var WshSysEnv = WshShell.Environment("System");
alert(WshSysEnv("NUMBER_OF_PROCESSORS"));
alert(WshSysEnv("PROCESSOR_ARCHITECTURE"));
alert(WshSysEnv("PROCESSOR_LEVEL"));
alert(WshSysEnv("PROCESSOR_REVISION"));
</script>

解决方案 »

  1.   

    还有一种是.vbs格式
    但都是比较安全的,
    不可能偷偷得到的
      

  2.   

    秋水:don't work on win98 + ie6.
      

  3.   

    w98 and Me only alow these envir strings
    <script>
    var WshShell = new ActiveXObject("WScript.Shell");
    var WshSysEnv = WshShell.Environment("Process");
    alert(WshSysEnv("COMSPEC"));
    alert(WshSysEnv("PATH"));
    alert(WshSysEnv("PROMPT"));
    alert(WshSysEnv("WINDIR"));
    alert(WshSysEnv("TEMP"));
    alert(WshSysEnv("TMP"));
    </script>
      

  4.   

    谢谢秋水! Type of Environment Variable Operating System 
    System Microsoft Windows NT/2000 
    Process Windows 95/98/Me 但好像安全问题是绕不过去了…
      

  5.   

    don't work on win98 + ie6.
      

  6.   

    放到Linux 服务器上报错:无法创建对象。还有,在本地测试也会跳出安全确认框…,看来这个东西还是不可行呀。