Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Javascript with CScript?

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?

like image 890
user541686 Avatar asked Aug 25 '11 09:08

user541686


2 Answers

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
like image 142
rplantiko Avatar answered Sep 25 '22 15:09

rplantiko


A very simple fix: use assoc.

c:\>assoc .js=JSFile

(Mine had become associated with a text editor at some point.)

like image 33
Steve Black Avatar answered Sep 24 '22 15:09

Steve Black