scriptexamplerunexecutable

This is an old revision of the document!


In MIStudio you can use the CommmandExecutor to run an external executable or script (.sh or .bat).

var Runtime = Java.type("java.lang.Runtime");
var Process = Java.type("java.lang.Process");
 //This runs the external program
//Consider running this in its own Thread
 
        try
        {
            // Command to create an external process
            command = "notepad";
  
            // Running the above command
            run  = Runtime.getRuntime();
            proc = run.exec(command); //will launch notepad.exe on windows
        }  catch (e) {             
           print("error in script: \n"+e.stack);
        }
 
output="finished";
  • scriptexamplerunexecutable.1673414109.txt.gz
  • Last modified: 2023/01/10 23:15
  • by wikiadmin