On Dec 10, 2016, at 11:36 AM, emerb nura wrote:
> Im new to Node.js,I want to execute shell commands using Node.js.When I tried a simple command(ipconfig), I got the outout.But I want to execute CLI commands, So in order to do so I need to execute the commands in a particular path .How to set path from script?. I used child_process.exec() for executing shell commands.Kindly share the code to execute the commands in a particular path. Thanks
Use the absolute path to the program, for example /usr/bin/someprogram, or else set the PATH environment variable to the directory in which the program can be found, for example /usr/bin. (If needed, PATH can contain multiple directories, separated by colon (":") characters.)