Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Does Jscript on windows really exist?

  1. May 30, 2005 #1
    does Jscript on windows really exist?!?!

    I read on various web pages that jscript can be used on windows as a scripting language directly form the DOS prompt. But I couldn't find ANY working example on the internet! even a simple alert("hello") put in a hello.js file doesn't work! It says an object is missing. Now I tried to find info on the web and after many attempts I am starting to doubt if this is just hype.

    Can I really run A SIMPLE alert("www") in a hello.js file from the DOS prompt without any errors ? does this jscript thing really exist ?

    (I also tried c:> cscript hello.js and others but to no avail........ Thanks if anyone knows anything about this.
  2. jcsd
  3. May 30, 2005 #2
    Problem is the exact case of the string WScript.

    (notice the WS...)

    var a=new Array(10000);


    WScript.echo (a[4877]);

    for(i=999;i<1010;i++) WScript.echo (a);

    It seems that some syntax is invented just to confuse; in vbs all cases work, in js not so, maybe to discourage a newbie to use js .... and then why didn't they maintain the alert() function ?

    Anyways you can use this quick and dirty programming language on any PC right off the bat, just save the program as .js and run from the command line.
    or run as cscript hello.js to see results as console.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook