Running Javascript with CScript?

user541686 picture user541686 · Aug 25, 2011 · Viewed 22k times · Source

I'm trying to learn how to run Javascript (instead of VBScript) using CScript.exe, but when I try, I get an error:

cscript temp.js
Input Error: There is no script engine for file extension ".js".

I thought this is possible -- any idea what's wrong?

Answer

rplantiko picture rplantiko · Jun 22, 2012

Setting the registry with regsvr32 did not work for me. Also, I don't want it, since I want my .js to be linked with a plain text editor.

But there is a command line option //E for cscript which makes the job:

cscript //E:jscript hello.js