Re: Jscript in Windows Startup script hangs

From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 03/07/04


Date: Sat, 6 Mar 2004 19:59:33 -0800

I do not know if the CoCreateInstance calls are different between VBScript's
CreateObject and JScript's new ActiveXObject to account for any differences,
but I will see what the WScript developers say.

-- 
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Uncle Stewie" <whoever@whatever.com> wrote in message
news:%23pJ0W9rAEHA.2040@TK2MSFTNGP12.phx.gbl...
David,
Thanks for the info... I have had issues that are confirmed by MS in the
past (at $250 a crack) that certain calls in jscript will not work where
vbscript will... This was another situation where a simple function should
work, but does not... The code that is failing is simply and instanciation
of a variable... a single line of code in the script hangs the system at the
Windows Startup Dialog and specifically says "Running Startup Scripts..."...
The code causing this is listed below and is a single line of code:
//begin file
var sho = new ActiveXObject("WScript.Shell");
//end file
The script runs fine under the context of a user on the system... Once
logged in the script runs fine... on Startup however there is this hang
issue... At first I suspected that it may be a security issue with the
System Account not having COM security priveliges... I looked into this and
it was not an issue... I then tried the same script (fully functional script
with sub functions) written in VBScript and it runs as expected... I then
went back to the jscript file cut it down to a single line of code (as seen
above) and the hang occurs every time... I changed the variable to a network
provider (var nwo = new ActiveXObject("WScript.Network")) and this also
hangs... I in fact tried 7 different providers... any instaciation of an
ActiveXObject seems to hang the jscript...
My question for you would be... If this were an anti-virus detection then
why would this not happen with a VBscript? Im going to look into this
today... Secondly, You would think there would be a system warning that a
rogue script was running... I get no indication of this in the event logs or
in the virus software...
By the way... I was in fact seeing an error in the application log... unable
to CoCreateObject ActiveXObject {GUID} Error with HRESULT 8000401A... This
turned out to be a mobsync.dll error and I resolved it by unregestering and
re-registering the mobsync.dll... I no longer receive this error...
Let me know if you have any additional thoughts..
"David Wang [Msft]" <someone@online.microsoft.com> wrote in message
news:uptSvAmAEHA.2480@TK2MSFTNGP11.phx.gbl...
> JScript does not hang for me on Windows Startup.
>
> I'm suspecting you may have some Antivirus/Security software that is
> blocking access, or maybe your JScript is failing with some exception that
> is halting script execution (and it is caught by a debugger).
>
> In any case, I would wager that it is the creation of some object in
JScript
> that is causing you issues, not whether JScript runs at a particular time
or
> not.
>
> -- 
> //David
> IIS
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> //
> "Uncle Stewie" <whoever@whatever.com> wrote in message
> news:uHa$p5fAEHA.3400@tk2msftngp13.phx.gbl...
> Has anyone encountered this...
>
> I have a simple jscript file that instantiates a Shell Object... The
system
> hangs on the system startup script... I know this because the windows
screen
> says "Running System Startup Script..." The exact same same code in
VBScript
> does not do this...
>
> Now I know some of you are saying... this is like the old doctor joke
where
> the patient says... "Doctor it hurts when I do this... ".. patient makes a
> motion... the doctor replies... ""Well then don't do that!"
>
> I realize I can just rewrite the script in VB although this is somewhat
> painful to me because of the lack of error handling capability in vbs...
> But, the ramifications of this are to me... larger... I guess after some
> investigation will I find that I cannot run jscript outside of a user
> session... i.e. start, and shutdown scripts... It seems that this would
> really stink... at least from my perspective... Does this then extend to
wsh
> file where a combination of scripting (both vb and js) fail...
>
> Any input (constructive) would be helpful...
>
> Thanks in advance,
>
> SB
>
>
>


Relevant Pages

  • Re: Jscript in Windows Startup script hangs
    ... Windows Startup Dialog and specifically says "Running Startup Scripts..."... ... The script runs fine under the context of a user on the system... ... went back to the jscript file cut it down to a single line of code (as seen ... above) and the hang occurs every time... ...
    (microsoft.public.scripting.jscript)
  • Re: Jscript in Windows Startup script hangs
    ... JScript does not hang for me on Windows Startup. ... is halting script execution. ...
    (microsoft.public.scripting.jscript)
  • Re: EventID 1054 from Userenv for startup script
    ... The policy folder containing the ... I added Authenticated Users to script folder ACL with Read & Execute ... but it still didn't run at startup. ... It obviously gets group policy ...
    (microsoft.public.windows.group_policy)
  • Update: tomcat startup
    ... we run Apache on this system, it is not for the benefit of tomcat. ... The relevant extract of the init script now looks like this: ... I get the expected tomcat startup lines in /tmp/tomcat_start.log. ...
    (Tru64-UNIX-Managers)
  • Re: AppleScript to keep Office 2004 or X from opening files and database on wrong drive?
    ... What would happen if the scripted startup item launched and it couldn't ... > with the script also resulted in the unmounting of the other.) ... >> of some of my beta testing, I've had drives so corrupted that the only ... >> rely on the duplicate until I got a replacement drive. ...
    (microsoft.public.mac.office)

Loading