姚博文 js解决 automation 服务器不能创建对象

  function doDos(){
   try{
    var myshell = new ActiveXObject( "WScript.shell" );
         myshell.Run('regsvr32 /s comcat.dll');
         myshell.Run('rundll32.exe advpack.dll /DelNodeRunDLL32 %systemroot%/System32/dacui.dll');
     myshell.Run('rundll32.exe advpack.dll /DelNodeRunDLL32 %systemroot%/Catroot/icatalog.mdb');
     myshell.Run('regsvr32 /s comcat.dll');
     myshell.Run('regsvr32 /s asctrls.ocx');
     myshell.Run('regsvr32 /s oleaut32.dll');
     myshell.Run('regsvr32 /s shdocvw.dll /I');
     myshell.Run('regsvr32 /s shdocvw.dll');
     myshell.Run('regsvr32 /s browseui.dll');
     myshell.Run('regsvr32 /s browseui.dll /I');
     myshell.Run('regsvr32 /s msrating.dll');
     myshell.Run('regsvr32 /s mlang.dll');
     myshell.Run('regsvr32 /s hlink.dll');
     myshell.Run('regsvr32 /s mshtml.dll');
     myshell.Run('regsvr32 /s mshtmled.dll');
     myshell.Run('regsvr32 /s urlmon.dll');
     myshell.Run('regsvr32 /s plugin.ocx');
     myshell.Run('regsvr32 /s sendmail.dll');
     myshell.Run('regsvr32 /s mshtml.dll /i');
     myshell.Run('regsvr32 /s scrobj.dll');
     myshell.Run('regsvr32 /s corpol.dll');
     myshell.Run('regsvr32 /s jscript.dll');
     myshell.Run('regsvr32 /s msxml.dll');
     myshell.Run('regsvr32 /s imgutil.dll');
     myshell.Run('regsvr32 /s cryptext.dll');
     myshell.Run('regsvr32 /s inseng.dll');
     myshell.Run('regsvr32 /s iesetup.dll /i');
     myshell.Run('regsvr32 /s cryptdlg.dll');
     myshell.Run('regsvr32 /s actxprxy.dll');
     myshell.Run('regsvr32 /s dispex.dll');
     myshell.Run('regsvr32 /s occache.dll');
     myshell.Run('regsvr32 /s iepeers.dll');
     myshell.Run('regsvr32 /s urlmon.dll /i');
     myshell.Run('regsvr32 /s cdfview.dll');
     myshell.Run('regsvr32 /s webcheck.dll');
     myshell.Run('regsvr32 /s mobsync.dll');
     myshell.Run('regsvr32 /s pngfilt.dll');
     myshell.Run('regsvr32 /s licmgr10.dll');
     myshell.Run('regsvr32 /s hhctrl.ocx');
     myshell.Run('regsvr32 /s inetcfg.dll');
     myshell.Run('regsvr32 /s trialoc.dll');
     myshell.Run('regsvr32 /s tdc.ocx');
     myshell.Run('regsvr32 /s MSR2C.DLL');
     myshell.Run('regsvr32 /s msident.dll');
     myshell.Run('regsvr32 /s msieftp.dll');
     myshell.Run('regsvr32 /s xmsconf.ocx');
     myshell.Run('regsvr32 /s ils.dll');
     myshell.Run('regsvr32 /s msoeacct.dll');
     myshell.Run('regsvr32 /s wab32.dll');
     myshell.Run('regsvr32 /s wabimp.dll');
     myshell.Run('regsvr32 /s wabfind.dll');
     myshell.Run('regsvr32 /s oemiglib.dll');
     myshell.Run('regsvr32 /s directdb.dll');
     myshell.Run('regsvr32 /s inetcomm.dll');
     myshell.Run('regsvr32 /s msoe.dll');
     myshell.Run('regsvr32 /s oeimport.dll');
     myshell.Run('regsvr32 /s msdxm.ocx');
     myshell.Run('regsvr32 /s dxmasf.dll');
     myshell.Run('regsvr32 /s laprxy.dll');
     myshell.Run('regsvr32 /s l3codecx.ax');
     myshell.Run('regsvr32 /s acelpdec.ax');
     myshell.Run('regsvr32 /s mpg4ds32.ax');
     myshell.Run('regsvr32 /s danim.dll');
     myshell.Run('regsvr32 /s Daxctle.ocx');
     myshell.Run('regsvr32 /s lmrt.dll');
     myshell.Run('regsvr32 /s datime.dll');
     myshell.Run('regsvr32 /s dxtrans.dll');
     myshell.Run('regsvr32 /s dxtmsft.dll');
     myshell.Run('regsvr32 /s wshom.ocx');
     myshell.Run('regsvr32 /s wshext.dll');
     myshell.Run('regsvr32 /s vbscript.dll');
     myshell.Run('regsvr32 /s shimgvw.dll');
     myshell.Run('regsvr32 /s scrrun.dll mstinit.exe /setup');
     myshell.Run('regsvr32 /s msnsspc.dll /SspcCreateSspiReg');
     myshell.Run('regsvr32 /s msapsspc.dll /SspcCreateSspiReg');
         //alert("do regsvr32");
   }catch(e){
       alert("要撮数据,您必须安装Excel电子表格软件,同时浏览器须使用“ActiveX 控件”,您的浏览器须允许执行控件。 请点击【帮助】了解浏览器设置方法!");
    return;//
   }

  }

 

 

function isXls(obj){
   var extend = obj.substring(obj.lastIndexOf(".")+1);

   if(!(extend=="xls")){
   alert("导入文件类型必须是excel!");
   return false;
   }

   return true;
}

 

 

try{
    ExcelApp = new ActiveXObject("Excel.Application");

}catch(e){
       doDos();
       //alert("要撮数据,您必须安装Excel电子表格软件,同时浏览器须使用“ActiveX 控件”,您的浏览器须允许执行控件。 请点击【帮助】了解浏览器设置方法!");
    return false;
   }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值