Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

srvany cannot start wscript, when no user is logged on

60 views
Skip to first unread message

Frank Urmoneit

unread,
Jan 15, 2004, 9:01:05 AM1/15/04
to
I like to start a WSH-script as a service and use srvany.exe.
When I start the service manually everything works perfect.
When the service is started by AUTOSTART after reboot/startup the wscript.exe cannot be startet. I get an Error in the event-log:

Source: Windows Script Host, Type: Failure Audit, Event ID: 1000,
Text: Attempt to execute Windows Script Host while it is disabled..

The Service is running under a local user-account with local admin-rights and logon as service rights

The Error only happens with NT4.0 (Service Pack 4 or 5), with Windows 2k or XP everything works fine.

Does anyone knows what "WSH disabled" means, or any other ideas what I can try?

thanks and eegards,
Frank

Frank Urmoneit

unread,
Jan 15, 2004, 3:21:12 PM1/15/04
to
Found the solution:
It seems that wscript is not completely loaded during startup, but srvany-Service starts already.

Solution:
srvany calls a *.bat file with following content:

:again
wscript c:\script.vbs
IF NOT "%ERRORLEVEL%"=="0" GOTO again

So wscript is called till there is no error anymore. To save resources write "sleep 2000" after the line ":again "

Torgeir Bakken (MVP)

unread,
Jan 15, 2004, 4:50:50 PM1/15/04
to
Frank Urmoneit wrote:

> Found the solution:
> It seems that wscript is not completely loaded during startup, but srvany-Service starts already.

Hi

Yes, this "Attempt to execute Windows Script Host while it is disabled" during the startup of NT4 is also reported
here for people using vbscript logon scripts. I think this problem was introduced by WSH 5.6 or one of it's updates.

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter


0 new messages