문제

Here is my code for running exe using javascript. It's working fine. Is there a way for me to know:

  1. When the exe closed.
  2. Get a return value from this app.

Also, what is the difference between using ShellExecute & Run?

     var sExePath = "c:\\Debug\\WebToCardReader_Test.exe";
     var oShell = new ActiveXObject("Shell.Application");
     var oExec = oShell.ShellExecute(sExePath, "", "", "open", "1");
도움이 되었습니까?

해결책

  1. Run allows you to set the boolean bWaitOnReturn flag, which blocks your script until the program returns.

  2. On that page, the VBScript sample simply assigns the command to a variable (as you've done with ShellExecute). I'm not sure if this works in JavaScript, but it's worth a shot.

    However, as you know, ShellExecute does allow you to store a return value.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top