Wednesday 7 June 2017

How to access c file in node js

I tried this way..

var exec = require('child_process').exec;
var cmd = 'executable.exe';
var path = 'c:\\path';
var child = exec(
      cmd, {
        cwd: path
    },
   function(error, stdout, stderr) {
      if (error === null) {
            console.log('success');
     } else {
            console.log('error');
        }
    }
  );

But still getting error Error: spawn UNKNOWN. Any idea why I am getting this error ?



via Abhishek Kumar Jain

No comments:

Post a Comment