omri
omri

Reputation: 11

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?

Upvotes: 0

Views: 111

Answers (1)

omri
omri

Reputation: 11

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();

Upvotes: 1

Related Questions