node.js execfile child process

execFile(script, (error1, stdout1, stderr1) => {
                        if (error1 || stderr1) {
                            logger.error(script);
                            logger.error("+++++++++++" + error1  );
                            reject(false);
                        }
                        if (stdout1) {
                            logger.info(script);
                            resolve(true);
                        }
                    });

Open in new window


when the script is log/getdata.bat
'log'is not recognized as an internal or external command, Pls suggest
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BigRatCommented:
Running on Windows? Then at least log\getdata.bat. Note that the command does not spawn a shell, so I would have started cmd.exe and have passed the script as an arg and set cwd to the required directory.

https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Node.js

From novice to tech pro — start learning today.