简体   繁体   中英

How to run external program(exe, bat) withing casperjs script

I have running casperjs program, i want during the script to wait for a few seconds and run exe file. it can be .bat as well. and then read the result from text file. as far as i know my only problem right now is to execute the external exe from the caseper program. i notice there is a solution for shell with a child process but how to do it on windows?

Find it! Maybe it will help someone...

var exec = require('child_process').execFile;
    var test = function(){
           console.log("test is running");
           exec('huh.exe', function(err, ans)
                {
                    console.log(err)
                console.log(ans.toString());
                });  
    }
test();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM