SpareNet Servers Advertising & Link Exchange

اطلاعیه

بستن
هیچ اطلاعیه ای هنوز ایجاد نشده است .

Run Exe In Web Page With JavaScript

بستن
X
 
  • فیلتر
  • زمان
  • نمایش
پاک کردن همه
نوشته‌های جدید

  • Run Exe In Web Page With JavaScript

    سلام بر عزیزان در این قسمت تمامی کد های مربوط به زبان جاوا اسکریپت برای لود کردن فایل های اجرایی بر روی صفحات وب قرار داده میشود :

    اولین کد :

    برای مرورگر IE

    کد:
     <html>
    <head>
    <script type="text/javascript" language="JavaScript">
    
    function LaunchNotepad()
    {
    var launcher = new ActiveXObject("Shell.Application");
    launcher.ShellExecute("notepad.exe", "", "", "open", "1");
    }
    
    function LaunchRegedit()
    {
    var launcher = new ActiveXObject("WScript.Shell");
    launcher.Run("Regedit.exe");
    }
    
    </script>
    </head>
    <body>
    <form name="Form1">
    <input name="ButtonNotepad" value="Launch Notepad.exe"
    onclick="LaunchNotepad()" type="button"> <br>
    <br>
    <input name="ButtonRegedit" value="Launch Regedit.exe"
    onclick="LaunchRegedit()" type="button">
    </form>
    </body>
    </html>
    [align=center][/align]

  • #2
    RE: Run Exe In Web Page With JavaScript

    بعدی

    کد:
    <script>
    function LaunchApp() {
    if (!document.all) {
      alert ("This ActiveXObject is only available for Internet Explorer");
      return;
    }
    var ws = new ActiveXObject("WScript.Shell");
    ws.Exec("D:\\Software\\youfile.exe");
    }
    </script>
    [align=center][/align]

    نظر


    • #3
      RE: Run Exe In Web Page With JavaScript

      ie and firefox run exe

      کد:
      <html>
      <head>
      <script>
      function RunExe(path) {
          try {            
              var ua = navigator.userAgent.toLowerCase();
              if (ua.indexOf("msie") != -1) {
                  MyObject = new ActiveXObject("WScript.Shell")
                  MyObject.Run(path);
              } else {
                  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      
                  var exe = window.Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
                  exe.initWithPath(path);
                  var run = window.Components.classes['@mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIProcess);
                  run.init(exe);
                  var parameters = [""];
                  run.run(false, parameters, parameters.length);
              }
          } catch (ex) {
              alert(ex.toString());
          }
      }
      </script>
      </head>
      <body>
      <a href="#" onclick="javascript:RunExe('C:\Windows\System32\cmd.exe /c start winword.exe');">Open Word</a>
      </body>
      [align=center][/align]

      نظر


      • #4
        RE: Run Exe In Web Page With JavaScript

        کد:
        <script>
        
        function LaunchApp() {
        
            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
        
            var file = Components.classes["@mozilla.org/file/local;1"]
        
            .createInstance(Components.interfaces.nsILocalFile);
        
            file.initWithPath("D:\\Software\\yourfile.exe");
        
            file.launch();
        
        }
        
        </script>
        [align=center][/align]

        نظر

        صبر کنید ..
        X