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

Upgrade php version of xampp not success -

amazon web services - S3 and apache mod_proxy with basic authentication -

powershell - This solution contains one or more assemblies targeted for the global assembly cache -