I’m looking for solution or NPM for calling Windows command line from node.js application.
What I want is call some batch files and run them on machine with node.js, of course with parameters and also read their output.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the standard module child_process.spawn() for this.
From the documentation example:
Replace
'ls'with'c:/windows/system32/cmd.exe', and['-lh', '/usr']with['/c', 'batfile.bat']to run the batch filebatfile.bat.