How to open .exe file from WinJS

I try to open a .exe application from WinJS, but I get an error message, this is my code:

    var comando = "C:\\Program%20Files%20(x86)\\Windows%20Media%20Player\\wmplayer.exe";
    var oShell = new ActiveXObject("Shell.Application");
    //var commandtoRun = "C:\\Windows\\notepad.exe";
    oShell.ShellExecute(comando, "", "", "open", "1");

but I get an error message ...

0x800A01AD - Runtime Error in JavaScript: Automation Server cannot create an object

any help I would appreciate

+4
source share
2 answers

I am afraid that it is not possible to use ActiveX controls in Windows Store apps for Windows. Windows Store applications are isolated from the system and cannot run arbitrary code outside the application container. It would be too easy to insert malware in this way.

+2
source

, . , , WinJS, , , . , .exe,.msi ..

.txt , :

var txtFile = "Assets\\myFile.txt";

Windows.ApplicationModel.Package.current.installedLocation.getFileAsync(txtFile).then(
  function (file) {
      Windows.System.Launcher.launchFileAsync(file).then(
        function (success) {
            if (success) {
                // File launched
            } else {
                // File launch failed
            }
        });
  });

, , , , .

+1

All Articles