执行 ExeRun("file:///c:/print.exe")时,页面变白屏,无反应,只能直接关闭。
请问这是什么问题?代码如下:
function   CreateFile(str)   
  {   
      var   fso,   tf;   
      fso   =   new   ActiveXObject("Scripting.FileSystemObject");  
  if (fso.FileExists("c:\\testfile.txt"))
  {
    fso.DeleteFile("c:\\testfile.txt");   }
      tf   =   fso.CreateTextFile("c:\\testfile.txt",   true);   
         
      tf.WriteLine(str)   ;   
        
     
      tf.Close();   
     ExeRun("file:///c:/print.exe");
  }     
function   ExeRun(command)   
  {   
  window.oldOnError=window.onerror;   
  window._command=command;   
  window.onerror=function(err)   
  {   
  if(err.indexOf('automation')!=-1)   
  {   
  alert("命令"+window._command+"已经被用户禁止!");     
            return   true;   
  }   
  else   return   false;   
  }   
  var   wsh=new   ActiveXObject("WScript.Shell");   
  if(wsh)   
  wsh.Run(command);   
  window.onerror=window.oldOnError;   
  }