Associating Javascript in Command ShellI ran across this error a few days ago while setting up a PHP server on my Windows XP Pro SP3 box for testing purposes.  As part of this setup, a script needs to be run that associates the .php extension with php-cgi.exe. Here is the script:

cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" ^
-extension:php -path:"C:\PHP\php-cgi.exe"

The problem, is that when I tried to run the script, I got the error: Input Error: There is no script engine for file extension “.js”. It took me quite a bit of searching before I found the fix that worked for me on this IBM forum. Hopefully, if you’re facing this issue, you find my article before the 100 other articles talking about the 99 other fixes that didn’t work for me. :)

Resolving the problem

Attempting to debug a Javascript-based Resource Model in the ITM Resource Model Builder (RMB), the “Play” button/icon is selected to start debugging. The Play icon changes from Green to grey, and the Stop icon turns from grey to Red, as it should when debugging is activated. But after a fraction of a second it stops and goes back to green without starting a debugger. Check the Javascript console for the error. Sometimes if the .JS extension was associated with something else on the system other than JSFile, it won’t be able to find the “ScriptEngine” entry for that type in HKEY_CLASSES_ROOT, and will fail to start the debugger. The lowest frame in the RMB window has a series of tabs at the bottom (Tasks, RMB Logging Viewer, RMB Indication Viewer, RMB Event Viewer, and Javascript Console). Choose “Javascript Console” tab to see any errors. For example, it might show the following:

Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Input Error: There is no script engine for file extension “.JS”.

If so, then check the current association of the “.JS” extension on that Windows system by running the following command:

ASSOC .JS

It should show something like “.js=JSFile” on a working system. If it shows something else, note what it is for safekeeping and then change it with:

ASSOC .JS=JSFile

Verify the change using “ASSOC .JS” again. Then retry the debugger to confirm it works this time, watching the Javascript console for any other errors.

This worked perfectly for me, allowing the script to complete successfully. I had tried associating the filetype in Folder Options, but for a reason I don’t fully understand, I was unsuccessful. I hope this helps!

7 Responses to “Input Error: There is no script engine for file extension “.js”.”

  1. DCWhatthe says:

    Been running around in circles, trying to resolve this, but finally got it. Thanks, CplShoe.

  2. CplShoe says:

    My pleasure. I hope I saved you some time, it took me quite awhile to come across this solution.

  3. CSK says:

    Thanks . You helped me to address this issue.

  4. Chowarmaan says:

    Thanks a lot. This corrected the problem I was having as well, and it took me a couple of hours of trying to correct the problem before I stumbled upon your fix here.

  5. Dan Greenfield says:

    Nice. It was associated with UltraEdit.js. I put it back to that after running the script. Hopefully I won’t need to change it again!

  6. Kalessin says:

    Thanks for that. Mine was associated with Notepad++ so today I learnt two lessons :)

  7. CplShoe says:

    Glad to see the article has helped so many people. Thanks for the feedback!

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2012 Network Night at Cpl-Shoe.com Suffusion WordPress theme by Sayontan Sinha