How to use nodejs to run .bat file

existing make.bat files for processing pictures. You need nodejs to call make.bat and pass in the image file. Excuse me, how can it be realized?

Apr.19,2022

almost forgot the difference between platforms.. If you just want to run .bat files on windows, you can take a look at this section of the document.

can use child_process.spawn () with the shell option set, or use child_process.exec (), or derive cmd.exe and pass in .bat or .cmd files as parameters (that is, what the shell option and child_process.exec () do).

here is the document link.


can be used if you can call cmd.exe.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b351d2-4d607.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b351d2-4d607.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?