javascript - Executing .bat file using Java-script -


can me in finding solution executing batch file using java-script, working nw.js , tried couple of things worked .exe not .bat

var execfile = require  ('child_process').execfile, child; child = execfile('c:\\worklog\\software\\abc.exe', //works //child = execfile('c:\\pdfrotation\\run.bat', //not working  

a batch program not executable, might have use cmd.exe invoke batch file try like:

var spawn = require('child-process').spawn;  spawn('cmd.exe', ['yourfile.bat']); 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -