Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fun = function() {
- console.log("rrrr");
- exec('CALL hai.exe', function(err, data) {
- console.log(err)
- console.log(data.toString());
- });
- }
- fun();
- var exec = require('child_process').execFile;
- var fun =function(){
- console.log("fun() start");
- exec('HelloJithin.exe', function(err, data) {
- console.log(err)
- console.log(data.toString());
- });
- }
- fun();
- var exec = require('child_process').execFile;
- /**
- * Function to execute exe
- * @param {string} fileName The name of the executable file to run.
- * @param {string[]} params List of string arguments.
- * @param {string} path Current working directory of the child process.
- */
- function execute(fileName, params, path) {
- let promise = new Promise((resolve, reject) => {
- exec(fileName, params, { cwd: path }, (err, data) => {
- if (err) reject(err);
- else resolve(data);
- });
- });
- return promise;
- }
Add Comment
Please, Sign In to add comment