I\'m trying to run javascript from a windows command line via script
cscript //NoLogo test.js
However, I can\'t find any predefined objects which are av
This is a very outdated thread, many of the answers are incomplete and/or simply don't work. The way to run JS in shell (regardless if you're using windows or not), is to use Node.js. After you have installed Node, you use it from command line, like this:
$ node
> console.log('Hello, world');
Hello, world
undefined
> .exit
or from a file:
$ cat hello.js
#!/usr/bin/node
console.log('Hello, world');
$ ./hello.js
Hello, world
Or from node itself:
$ node hello.js
Hello, world