Re: cscript sometimes fails to run JScript



i would say its an issue with this particular pc... have you tried it
anywhere else?
either a file permission problem, or maybe some AV software blocking
execution randomly




"Aldrich" <davidandbella@xxxxxxxxxxxxxxxxxxx> wrote in message
news:44bfaf02_1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi

I have written a JScript that I execute under cscript from the Windows
cmd line. It runs fine on my PC which runs Windows XP SP2 and WSH
version 5.6.

However, if I run it on a colleague's PC with the same XP and WSH
builds, the script runs only about 3 out of 4 tries. When it fails no
code in the script executes and no error is displayed. To demonstrate
this I tried running a script 'MyScript.js' containing only the line:

WScript.StdOut.WriteLine("Started!");

Here is a snippet of the cmd window showing successive runs:

C:\Work>cscript MyScript.js
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Started!

C:\Work>cscript MyScript.js
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Started!

C:\Work>cscript MyScript.js
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.


C:\Work>cscript MyScript.js
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Started!

As you can see, on one occasion the script did not execute at all.

If I use the //D switch, I always see an "Access is denied" message.

C:\Work>cscript MyScript.js //D
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

CScript Error: Initialization of the Windows Script Host failed.
(Access is denied. )

Please can anyone suggest what is causing the script not to run?

David




.



Relevant Pages

  • Sharing Violation with xcopy -after adsutil.vbs APPUNLOAD & iis st
    ... files to the web server and keep getting sharing violation. ... xcopy filename1.dll destdir ... Microsoft Windows Script Host Version 5.6 ... Copyright Microsoft Corporation 1996-2001. ...
    (microsoft.public.inetserver.iis)
  • cscript sometimes fails to run JScript
    ... I have written a JScript that I execute under cscript from the Windows ... Here is a snippet of the cmd window showing successive runs: ... Microsoft Windows Script Host Version 5.6 ... Copyright Microsoft Corporation 1996-2001. ...
    (microsoft.public.scripting.wsh)
  • Re: adding disclaimer with visual basic SMTP transport event sink
    ... Microsoft Windows Script Host Version 5.6 ... Copyright Microsoft Corporation 1996-2001. ... Binding Display Name Specified: SMTPScriptingHost ...
    (microsoft.public.exchange.admin)
  • Re: how to enble icf remotely
    ... That is only half the problem, you need to determine the interface you ... turn on and off ICF for any or all interfaces. ... Microsoft Windows Script Host Version 5.6 ... Copyright Microsoft Corporation 1996-2001. ...
    (NT-Bugtraq)
  • Re: Aaagh! cScript no longer Returning! ??
    ... the first time I tried it I miss-spelled the ... the correct .vbs file, and it never returned; ... Microsoft Windows Script Host Version 5.1 for Windows ... Copyright Microsoft Corporation 1996-1999. ...
    (microsoft.public.scripting.vbscript)